Index: trunk/libcloud/test/compute/test_ibm_sce.py =================================================================== --- trunk/libcloud/test/compute/test_ibm_sce.py (revision 1433252) +++ trunk/libcloud/test/compute/test_ibm_sce.py (working copy) @@ -187,6 +187,12 @@ IBMMockHttp.type = 'DESTROY' ret = self.driver.destroy_volume(vols[0]) self.assertTrue(ret) + + def test_ex_destroy_image(self): + image = self.driver.list_images() + IBMMockHttp.type = 'DESTROY' + ret = self.driver.ex_destroy_image(image[0]) + self.assertTrue(ret) def test_detach_volume(self): nodes = self.driver.list_nodes() @@ -278,7 +284,11 @@ def _computecloud_enterprise_api_rest_20100331_storage_39281_DESTROY(self, method, url, body, headers): body = self.fixtures.load('destroy_volume.xml') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - + + def _computecloud_enterprise_api_rest_20100331_offerings_image_20078374_DESTROY(self, method, url, body, headers): + body = self.fixtures.load('destroy_image.xml') + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + def _computecloud_enterprise_api_rest_20100331_instances_26557_DETACH(self, method, url, body, headers): body = self.fixtures.load('detach_volume.xml') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) Index: trunk/libcloud/test/compute/fixtures/ibm_sce/destroy_image.xml =================================================================== --- trunk/libcloud/test/compute/fixtures/ibm_sce/destroy_image.xml (revision 0) +++ trunk/libcloud/test/compute/fixtures/ibm_sce/destroy_image.xml (working copy) @@ -0,0 +1 @@ + \ No newline at end of file Index: trunk/libcloud/compute/drivers/ibm_sce.py =================================================================== --- trunk/libcloud/compute/drivers/ibm_sce.py (revision 1433252) +++ trunk/libcloud/compute/drivers/ibm_sce.py (working copy) @@ -345,6 +345,21 @@ method='DELETE').status) return status == 200 + def ex_destroy_image(self,image): + """ + Destroys an image. + + @param image: Image to be destroyed + @type image: L{NodeImage} + + @return: C{bool} + """ + + url = REST_BASE + '/offerings/image/%s' % (image.id) + status = int(self.connection.request(action=url, + method='DELETE').status) + return status == 200 + def attach_volume(self, node, volume): """ Attaches volume to node.