LP Bug#914770 - NameError in test_images

Thanks to bcwaldon for making me look silly :)

Now checks the location header returned from createImage
call in the case when the image is erroneously created
and should then be deleted...

Change-Id: Iec303355ccb7d19fd4667462b82fc8e95bdafde7
diff --git a/tempest/services/nova/json/servers_client.py b/tempest/services/nova/json/servers_client.py
index f68d140..2be30c5 100644
--- a/tempest/services/nova/json/servers_client.py
+++ b/tempest/services/nova/json/servers_client.py
@@ -258,7 +258,6 @@
         post_body = json.dumps(post_body)
         resp, body = self.client.post('servers/%s/action' %
                                       str(server_id), post_body, self.headers)
-        body = json.loads(body)
         return resp, body
 
     def list_server_metadata(self, server_id):
diff --git a/tempest/tests/test_images.py b/tempest/tests/test_images.py
index 4d00ebf..40f5fa7 100644
--- a/tempest/tests/test_images.py
+++ b/tempest/tests/test_images.py
@@ -61,7 +61,7 @@
 
     @attr(type='negative')
     def test_create_image_from_deleted_server(self):
-        """An image should not be created as the server instance is removed """
+        """An image should not be created if the server instance is removed """
         server_name = rand_name('server')
         resp, server = self.servers_client.create_server(server_name,
                                                          self.image_ref,
@@ -81,6 +81,6 @@
             pass
 
         else:
-            self.fail("should not create snapshot from deleted instance")
-        # Delete Image in case the test filed and image created
-        self.client.delete_image(image['id'])
+            self.fail("Should not create snapshot from deleted instance!")
+            image_id = _parse_image_id(resp.['location'])
+            self.client.delete_image(image_id)