diff --git libcloud/compute/drivers/openstack.py libcloud/compute/drivers/openstack.py index 8883c52..ade1644 100644 --- libcloud/compute/drivers/openstack.py +++ libcloud/compute/drivers/openstack.py @@ -991,12 +991,9 @@ class OpenStack_1_1_NodeDriver(OpenStackNodeDriver): .object['image']) def ex_delete_image(self, image): - # This has not yet been implemented by OpenStack 1.1 - raise NotImplementedError() - resp = self.connection.request('/images/%s' % (image.id,), method='DELETE') - return resp.status == httplib.ACCEPTED + return resp.status == httplib.NO_CONTENT def _node_action(self, node, action, **params): params = params or None diff --git test/compute/test_openstack.py test/compute/test_openstack.py index d2f6de0..55fc1ec 100644 --- test/compute/test_openstack.py +++ test/compute/test_openstack.py @@ -670,12 +670,8 @@ class OpenStack_1_1_Tests(unittest.TestCase, TestCaseMixin): def test_ex_delete_image(self): image = NodeImage(id='26365521-8c62-11f9-2c33-283d153ecc3a', name='My Backup', driver=self.driver) - try: - self.driver.ex_delete_image(image) - except NotImplementedError: - pass - else: - self.fail('An expected error was not raised') + result = self.driver.ex_delete_image(image) + self.assertTrue(result) class OpenStack_1_1_FactoryMethodTests(OpenStack_1_1_Tests): should_list_locations = False @@ -788,9 +784,9 @@ class OpenStack_1_1_MockHttp(MockHttpTestCase): else: raise NotImplementedError() - def _v1_1_slug_images_DELETEUUID(self, method, url, body, headers): + def _v1_1_slug_images_26365521_8c62_11f9_2c33_283d153ecc3a(self, method, url, body, headers): if method == "DELETE": - return (httplib.ACCEPTED, "", {}, httplib.responses[httplib.ACCEPTED]) + return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.NO_CONTENT]) else: raise NotImplementedError()