libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1228809 - in /libcloud/trunk: CHANGES libcloud/compute/drivers/openstack.py test/compute/test_openstack.py
Date Sun, 08 Jan 2012 08:37:41 GMT
Author: tomaz
Date: Sun Jan  8 08:37:40 2012
New Revision: 1228809

URL: http://svn.apache.org/viewvc?rev=1228809&view=rev
Log:
Enable ex_delete_image method in the OpenStack 1.1 compute driver. This patch
has been contributed by Shawn Smith <shawnpsmith at gmail dot comA> and is 
part of LIBCLOUD-141.

Modified:
    libcloud/trunk/CHANGES
    libcloud/trunk/libcloud/compute/drivers/openstack.py
    libcloud/trunk/test/compute/test_openstack.py

Modified: libcloud/trunk/CHANGES
URL: http://svn.apache.org/viewvc/libcloud/trunk/CHANGES?rev=1228809&r1=1228808&r2=1228809&view=diff
==============================================================================
--- libcloud/trunk/CHANGES (original)
+++ libcloud/trunk/CHANGES Sun Jan  8 08:37:40 2012
@@ -31,6 +31,9 @@ Changes with Apache Libcloud in developm
        has been removed from the OpenNebula driver.
        [Hutson Betts]
 
+     - Enable ex_delete_image method in the OpenStack 1.1 driver.
+       [Shawn Smith]
+
   *) Storage:
 
     - Propagate extra keyword arguments passed to the Rackspace driver

Modified: libcloud/trunk/libcloud/compute/drivers/openstack.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/compute/drivers/openstack.py?rev=1228809&r1=1228808&r2=1228809&view=diff
==============================================================================
--- libcloud/trunk/libcloud/compute/drivers/openstack.py (original)
+++ libcloud/trunk/libcloud/compute/drivers/openstack.py Sun Jan  8 08:37:40 2012
@@ -991,12 +991,9 @@ class OpenStack_1_1_NodeDriver(OpenStack
                    .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

Modified: libcloud/trunk/test/compute/test_openstack.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/test/compute/test_openstack.py?rev=1228809&r1=1228808&r2=1228809&view=diff
==============================================================================
--- libcloud/trunk/test/compute/test_openstack.py (original)
+++ libcloud/trunk/test/compute/test_openstack.py Sun Jan  8 08:37:40 2012
@@ -670,12 +670,8 @@ class OpenStack_1_1_Tests(unittest.TestC
 
     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(MockHttpTes
         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()
 



Mime
View raw message