libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1156488 - in /libcloud/trunk: libcloud/compute/drivers/rackspace.py test/compute/test_rackspace.py
Date Thu, 11 Aug 2011 05:18:02 GMT
Author: tomaz
Date: Thu Aug 11 05:18:02 2011
New Revision: 1156488

URL: http://svn.apache.org/viewvc?rev=1156488&view=rev
Log:
Properly populate NodeImge "details" dictionary in the Rackspace compute driver.

Patch has been contributed by Lucy Mendel <lucy dot mendel at rackspace dot com>
and is part of LIBCLOUD-107.

Modified:
    libcloud/trunk/libcloud/compute/drivers/rackspace.py
    libcloud/trunk/test/compute/test_rackspace.py

Modified: libcloud/trunk/libcloud/compute/drivers/rackspace.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/compute/drivers/rackspace.py?rev=1156488&r1=1156487&r2=1156488&view=diff
==============================================================================
--- libcloud/trunk/libcloud/compute/drivers/rackspace.py (original)
+++ libcloud/trunk/libcloud/compute/drivers/rackspace.py Thu Aug 11 05:18:02 2011
@@ -297,7 +297,7 @@ class RackspaceNodeDriver(NodeDriver):
     def ex_confirm_resize(self, node):
         """
         Confirm a resize request which is currently in progress. If a resize
-        request is not explicitly confirmed or reverted it's automatically 
+        request is not explicitly confirmed or reverted it's automatically
         confirmed after 24 hours.
 
         For more info refer to the API documentation: http://goo.gl/zjFI1
@@ -565,9 +565,13 @@ class RackspaceNodeDriver(NodeDriver):
 
     def _to_image(self, el):
         i = NodeImage(id=el.get('id'),
-                     name=el.get('name'),
-                     driver=self.connection.driver,
-                     extra={'serverId': el.get('serverId')})
+                      name=el.get('name'),
+                      driver=self.connection.driver,
+                      extra={'updated': el.get('updated'),
+                             'created': el.get('created'),
+                             'status': el.get('status'),
+                             'serverId': el.get('serverId'),
+                             'progress': el.get('progress')})
         return i
 
     def ex_limits(self):

Modified: libcloud/trunk/test/compute/test_rackspace.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/test/compute/test_rackspace.py?rev=1156488&r1=1156487&r2=1156488&view=diff
==============================================================================
--- libcloud/trunk/test/compute/test_rackspace.py (original)
+++ libcloud/trunk/test/compute/test_rackspace.py Thu Aug 11 05:18:02 2011
@@ -97,8 +97,19 @@ class RackspaceTests(unittest.TestCase, 
 
     def test_list_images(self):
         ret = self.driver.list_images()
-        self.assertEqual(ret[10].extra['serverId'], None)
-        self.assertEqual(ret[11].extra['serverId'], '91221')
+        expected = {10: {'serverId': None,
+                         'status': 'ACTIVE',
+                         'created': '2009-07-20T09:14:37-05:00',
+                         'updated': '2009-07-20T09:14:37-05:00',
+                         'progress': None},
+                    11: {'serverId': '91221',
+                         'status': 'ACTIVE',
+                         'created': '2009-11-29T20:22:09-06:00',
+                         'updated': '2009-11-29T20:24:08-06:00',
+                         'progress': '100'}}
+        for ret_idx, extra in expected.items():
+            for key, value in extra.items():
+                self.assertEqual(ret[ret_idx].extra[key], value)
 
     def test_create_node(self):
         image = NodeImage(id=11, name='Ubuntu 8.10 (intrepid)',



Mime
View raw message