Skip to content

Commit

Permalink
Minor change in get volumes
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed Jun 18, 2024
1 parent 03a906d commit 9a46b5c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions IM/connectors/OpenStack.py
Original file line number Diff line number Diff line change
Expand Up @@ -1184,8 +1184,7 @@ def get_networks(self, driver, radl):

return nets

@staticmethod
def get_volumes(driver, image, volume, radl):
def get_volumes(self, driver, image, volume, radl):
"""
Create the required volumes (in the RADL) for the VM.
Expand Down Expand Up @@ -1226,13 +1225,17 @@ def get_volumes(driver, image, volume, radl):

disk_size = None
if disk_url:
new_volume = driver.ex_get_volume(os.path.basename(disk_url))
try:
new_volume_id = driver.ex_get_volume(os.path.basename(disk_url)).id
except Exception:
self.log_war("Error getting volume %s. Using ID." % disk_url)
new_volume_id = os.path.basename(disk_url)
disk = {
'boot_index': cont,
'source_type': "volume",
'delete_on_termination': False,
'destination_type': "volume",
'uuid': new_volume.id
'uuid': new_volume_id
}
else:
disk_size = system.getFeature("disk." + str(cont) + ".size").getValue('G')
Expand Down

0 comments on commit 9a46b5c

Please sign in to comment.