We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Project id not respected when deleting disk in Cloudstack
I forgot to pass project_id as an agrugment when deleting volume. 


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `perfkitbenchmarker/cloudstack/cloudstack_disk.py`
Content:
```
1 # Copyright 2014 Google Inc. All rights reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #   http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 """Module containing classes related to CloudStack disks.
15 
16 Disks can be created, deleted, attached to VMs, and detached from VMs.
17 """
18 
19 from perfkitbenchmarker import disk
20 from perfkitbenchmarker import vm_util
21 from perfkitbenchmarker import flags
22 from perfkitbenchmarker.cloudstack import util
23 
24 import string
25 import logging
26 
27 FLAGS = flags.FLAGS
28 
29 
30 class CloudStackDisk(disk.BaseDisk):
31   """Object representing a Cloudstack Disk."""
32 
33 
34   def __init__(self, disk_spec, name, zone_id, project_id=None):
35     super(CloudStackDisk, self).__init__(disk_spec)
36 
37     self.cs = util.CsClient(
38         FLAGS.CS_API_URL,
39         FLAGS.CS_API_KEY,
40         FLAGS.CS_API_SECRET
41     )
42 
43     self.attached_vm_name = None
44     self.attached_vm_id = None
45     self.name = name
46 
47     self.zone_id = zone_id
48     self.project_id = project_id
49 
50     self.disk_offering_id = self._GetBestOfferingId(self.disk_size)
51     assert self.disk_offering_id, "Unable get disk offering of given size"
52 
53     if self.disk_spec.disk_type:
54         logging.warn("Cloudstack does not support disk types")
55 
56 
57   @vm_util.Retry(max_retries=3)
58   def _Create(self):
59     """Creates the disk."""
60 
61 
62     volume = self.cs.create_volume(self.name,
63                                    self.disk_offering_id,
64                                    self.zone_id,
65                                    self.project_id)
66 
67     assert volume, "Unable to create volume"
68 
69     self.volume_id = volume['id']
70     self.disk_type = volume['type']
71     self.actual_disk_size = int(volume['size']) / (2 ** 30)  # In GB
72 
73 
74   def _Delete(self):
75     """Deletes the disk."""
76     vol = self.cs.get_volume(self.name)
77     if vol:
78         self.cs.delete_volume(self.volume_id)
79 
80 
81   def _Exists(self):
82     """Returns true if the disk exists."""
83     vol = self.cs.get_volume(self.name, self.project_id)
84     if vol:
85         return True
86     return False
87 
88 
89   @vm_util.Retry(max_retries=3)
90   def Attach(self, vm):
91     """Attaches the disk to a VM.
92 
93     Args:
94       vm: The CloudStackVirtualMachine instance to which
95       the disk will be attached.
96 
97     """
98 
99     res = self.cs.attach_volume(self.volume_id, vm.id)
100     assert res, "Unable to attach volume"
101 
102     self.device_id = res['deviceid']
103 
104     self.device_path = "/dev/xvd" + \
105         str(string.ascii_lowercase[self.device_id])
106 
107 
108 
109   def Detach(self):
110     """Detaches the disk from a VM."""
111 
112     self.cs.detach_volume(self.volume_id)
113 
114 
115   def _GetBestOfferingId(self, disk_size):
116     """ Given a disk_size (in GB), try to find a disk
117     offering that is atleast as big as the requested
118     one.
119     """
120 
121     disk_offerings = self.cs.list_disk_offerings()
122     sorted_do = sorted(disk_offerings, key=lambda x: x['disksize'])
123 
124     for do in sorted_do:
125         if int(do['disksize']) >= disk_size:
126             return do['id']
127 
128     return None
129
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/perfkitbenchmarker/cloudstack/cloudstack_disk.py b/perfkitbenchmarker/cloudstack/cloudstack_disk.py
--- a/perfkitbenchmarker/cloudstack/cloudstack_disk.py
+++ b/perfkitbenchmarker/cloudstack/cloudstack_disk.py
@@ -50,7 +50,7 @@
     self.disk_offering_id = self._GetBestOfferingId(self.disk_size)
     assert self.disk_offering_id, "Unable get disk offering of given size"
 
-    if self.disk_spec.disk_type:
+    if disk_spec.disk_type:
         logging.warn("Cloudstack does not support disk types")
 
 
@@ -73,7 +73,7 @@
 
   def _Delete(self):
     """Deletes the disk."""
-    vol = self.cs.get_volume(self.name)
+    vol = self.cs.get_volume(self.name, self.project_id)
     if vol:
         self.cs.delete_volume(self.volume_id)

{"golden_diff": "diff --git a/perfkitbenchmarker/cloudstack/cloudstack_disk.py b/perfkitbenchmarker/cloudstack/cloudstack_disk.py\n--- a/perfkitbenchmarker/cloudstack/cloudstack_disk.py\n+++ b/perfkitbenchmarker/cloudstack/cloudstack_disk.py\n@@ -50,7 +50,7 @@\n     self.disk_offering_id = self._GetBestOfferingId(self.disk_size)\n     assert self.disk_offering_id, \"Unable get disk offering of given size\"\n \n-    if self.disk_spec.disk_type:\n+    if disk_spec.disk_type:\n         logging.warn(\"Cloudstack does not support disk types\")\n \n \n@@ -73,7 +73,7 @@\n \n   def _Delete(self):\n     \"\"\"Deletes the disk.\"\"\"\n-    vol = self.cs.get_volume(self.name)\n+    vol = self.cs.get_volume(self.name, self.project_id)\n     if vol:\n         self.cs.delete_volume(self.volume_id)\n", "issue": "Project id not respected when deleting disk in Cloudstack\nI forgot to pass project_id as an agrugment when deleting volume. \n\n", "before_files": [{"content": "# Copyright 2014 Google Inc. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module containing classes related to CloudStack disks.\n\nDisks can be created, deleted, attached to VMs, and detached from VMs.\n\"\"\"\n\nfrom perfkitbenchmarker import disk\nfrom perfkitbenchmarker import vm_util\nfrom perfkitbenchmarker import flags\nfrom perfkitbenchmarker.cloudstack import util\n\nimport string\nimport logging\n\nFLAGS = flags.FLAGS\n\n\nclass CloudStackDisk(disk.BaseDisk):\n  \"\"\"Object representing a Cloudstack Disk.\"\"\"\n\n\n  def __init__(self, disk_spec, name, zone_id, project_id=None):\n    super(CloudStackDisk, self).__init__(disk_spec)\n\n    self.cs = util.CsClient(\n        FLAGS.CS_API_URL,\n        FLAGS.CS_API_KEY,\n        FLAGS.CS_API_SECRET\n    )\n\n    self.attached_vm_name = None\n    self.attached_vm_id = None\n    self.name = name\n\n    self.zone_id = zone_id\n    self.project_id = project_id\n\n    self.disk_offering_id = self._GetBestOfferingId(self.disk_size)\n    assert self.disk_offering_id, \"Unable get disk offering of given size\"\n\n    if self.disk_spec.disk_type:\n        logging.warn(\"Cloudstack does not support disk types\")\n\n\n  @vm_util.Retry(max_retries=3)\n  def _Create(self):\n    \"\"\"Creates the disk.\"\"\"\n\n\n    volume = self.cs.create_volume(self.name,\n                                   self.disk_offering_id,\n                                   self.zone_id,\n                                   self.project_id)\n\n    assert volume, \"Unable to create volume\"\n\n    self.volume_id = volume['id']\n    self.disk_type = volume['type']\n    self.actual_disk_size = int(volume['size']) / (2 ** 30)  # In GB\n\n\n  def _Delete(self):\n    \"\"\"Deletes the disk.\"\"\"\n    vol = self.cs.get_volume(self.name)\n    if vol:\n        self.cs.delete_volume(self.volume_id)\n\n\n  def _Exists(self):\n    \"\"\"Returns true if the disk exists.\"\"\"\n    vol = self.cs.get_volume(self.name, self.project_id)\n    if vol:\n        return True\n    return False\n\n\n  @vm_util.Retry(max_retries=3)\n  def Attach(self, vm):\n    \"\"\"Attaches the disk to a VM.\n\n    Args:\n      vm: The CloudStackVirtualMachine instance to which\n      the disk will be attached.\n\n    \"\"\"\n\n    res = self.cs.attach_volume(self.volume_id, vm.id)\n    assert res, \"Unable to attach volume\"\n\n    self.device_id = res['deviceid']\n\n    self.device_path = \"/dev/xvd\" + \\\n        str(string.ascii_lowercase[self.device_id])\n\n\n\n  def Detach(self):\n    \"\"\"Detaches the disk from a VM.\"\"\"\n\n    self.cs.detach_volume(self.volume_id)\n\n\n  def _GetBestOfferingId(self, disk_size):\n    \"\"\" Given a disk_size (in GB), try to find a disk\n    offering that is atleast as big as the requested\n    one.\n    \"\"\"\n\n    disk_offerings = self.cs.list_disk_offerings()\n    sorted_do = sorted(disk_offerings, key=lambda x: x['disksize'])\n\n    for do in sorted_do:\n        if int(do['disksize']) >= disk_size:\n            return do['id']\n\n    return None\n", "path": "perfkitbenchmarker/cloudstack/cloudstack_disk.py"}], "after_files": [{"content": "# Copyright 2014 Google Inc. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Module containing classes related to CloudStack disks.\n\nDisks can be created, deleted, attached to VMs, and detached from VMs.\n\"\"\"\n\nfrom perfkitbenchmarker import disk\nfrom perfkitbenchmarker import vm_util\nfrom perfkitbenchmarker import flags\nfrom perfkitbenchmarker.cloudstack import util\n\nimport string\nimport logging\n\nFLAGS = flags.FLAGS\n\n\nclass CloudStackDisk(disk.BaseDisk):\n  \"\"\"Object representing a Cloudstack Disk.\"\"\"\n\n\n  def __init__(self, disk_spec, name, zone_id, project_id=None):\n    super(CloudStackDisk, self).__init__(disk_spec)\n\n    self.cs = util.CsClient(\n        FLAGS.CS_API_URL,\n        FLAGS.CS_API_KEY,\n        FLAGS.CS_API_SECRET\n    )\n\n    self.attached_vm_name = None\n    self.attached_vm_id = None\n    self.name = name\n\n    self.zone_id = zone_id\n    self.project_id = project_id\n\n    self.disk_offering_id = self._GetBestOfferingId(self.disk_size)\n    assert self.disk_offering_id, \"Unable get disk offering of given size\"\n\n    if disk_spec.disk_type:\n        logging.warn(\"Cloudstack does not support disk types\")\n\n\n  @vm_util.Retry(max_retries=3)\n  def _Create(self):\n    \"\"\"Creates the disk.\"\"\"\n\n\n    volume = self.cs.create_volume(self.name,\n                                   self.disk_offering_id,\n                                   self.zone_id,\n                                   self.project_id)\n\n    assert volume, \"Unable to create volume\"\n\n    self.volume_id = volume['id']\n    self.disk_type = volume['type']\n    self.actual_disk_size = int(volume['size']) / (2 ** 30)  # In GB\n\n\n  def _Delete(self):\n    \"\"\"Deletes the disk.\"\"\"\n    vol = self.cs.get_volume(self.name, self.project_id)\n    if vol:\n        self.cs.delete_volume(self.volume_id)\n\n\n  def _Exists(self):\n    \"\"\"Returns true if the disk exists.\"\"\"\n    vol = self.cs.get_volume(self.name, self.project_id)\n    if vol:\n        return True\n    return False\n\n\n  @vm_util.Retry(max_retries=3)\n  def Attach(self, vm):\n    \"\"\"Attaches the disk to a VM.\n\n    Args:\n      vm: The CloudStackVirtualMachine instance to which\n      the disk will be attached.\n\n    \"\"\"\n\n    res = self.cs.attach_volume(self.volume_id, vm.id)\n    assert res, \"Unable to attach volume\"\n\n    self.device_id = res['deviceid']\n\n    self.device_path = \"/dev/xvd\" + \\\n        str(string.ascii_lowercase[self.device_id])\n\n\n\n  def Detach(self):\n    \"\"\"Detaches the disk from a VM.\"\"\"\n\n    self.cs.detach_volume(self.volume_id)\n\n\n  def _GetBestOfferingId(self, disk_size):\n    \"\"\" Given a disk_size (in GB), try to find a disk\n    offering that is atleast as big as the requested\n    one.\n    \"\"\"\n\n    disk_offerings = self.cs.list_disk_offerings()\n    sorted_do = sorted(disk_offerings, key=lambda x: x['disksize'])\n\n    for do in sorted_do:\n        if int(do['disksize']) >= disk_size:\n            return do['id']\n\n    return None\n", "path": "perfkitbenchmarker/cloudstack/cloudstack_disk.py"}]}