test_create_server_from_volume_snapshot: assert dict is not empty before accessing a key
Following the patch: If2a257b24f2d50a401d6804e983bcad55b5c89e8
In case the dict is empty i.e. there in not an attachment, it will
be helpful to check whether there is an attachment or not to prevent
error in L204.
Change-Id: Ib74472b3b147f34a63ac5988c7db97230a9f4803
diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
index 9486b96..4064e04 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -198,6 +198,8 @@
# The created volume when creating a server from a snapshot
created_volume = server_info['os-extended-volumes:volumes_attached']
+ self.assertNotEmpty(created_volume, "No volume attachment found.")
+
created_volume_info = self.volumes_client.show_volume(
created_volume[0]['id'])['volume']