Fix KeyError when image was deleted
KeyError was raised when volume was created from image and then this image is deleted. THis patch adds additional check to avoid such situations. Change-Id: I85712fd9587d8815d2f3c74227ded9a4f62296f3
This commit is contained in:
parent
5601ea9477
commit
a1559be778
@ -182,7 +182,9 @@ class IndexView(tables.PagedTableMixin, tables.DataTableView):
|
||||
# Getting volume object, which is as attached
|
||||
# as the first device
|
||||
boot_volume = volume_dict[instance_volumes[0]['id']]
|
||||
if hasattr(boot_volume, "volume_image_metadata"):
|
||||
if (hasattr(boot_volume, "volume_image_metadata") and
|
||||
boot_volume.volume_image_metadata['image_id'] in
|
||||
image_dict):
|
||||
instance.image = image_dict[
|
||||
boot_volume.volume_image_metadata['image_id']
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user