Merge ""is_resource_deleted" fails to verify delete"
diff --git a/tempest/lib/services/compute/images_client.py b/tempest/lib/services/compute/images_client.py
index 4a55ce7..da8a61e 100644
--- a/tempest/lib/services/compute/images_client.py
+++ b/tempest/lib/services/compute/images_client.py
@@ -131,8 +131,10 @@
return rest_client.ResponseBody(resp, body)
def is_resource_deleted(self, id):
+ # Added status check for user with admin role
try:
- self.show_image(id)
+ if self.show_image(id)['image']['status'] == 'DELETED':
+ return True
except lib_exc.NotFound:
return True
return False
diff --git a/tempest/services/image/v1/json/images_client.py b/tempest/services/image/v1/json/images_client.py
index 3f256ec..e29ff89 100644
--- a/tempest/services/image/v1/json/images_client.py
+++ b/tempest/services/image/v1/json/images_client.py
@@ -213,7 +213,8 @@
def is_resource_deleted(self, id):
try:
- self.get_image_meta(id)
+ if self.get_image_meta(id)['status'] == 'deleted':
+ return True
except lib_exc.NotFound:
return True
return False
diff --git a/tempest/tests/lib/services/compute/test_images_client.py b/tempest/tests/lib/services/compute/test_images_client.py
index 28757c3..3ebc27f 100644
--- a/tempest/tests/lib/services/compute/test_images_client.py
+++ b/tempest/tests/lib/services/compute/test_images_client.py
@@ -186,7 +186,7 @@
def _test_resource_deleted(self, bytes_body=False):
params = {"id": self.FAKE_IMAGE_ID}
- expected_op = self.FAKE_IMAGE_DATA['show']['image']
+ expected_op = self.FAKE_IMAGE_DATA['show']
self.useFixture(mockpatch.Patch('tempest.lib.services.compute'
'.images_client.ImagesClient.show_image',
side_effect=lib_exc.NotFound))