libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1298491 - in /libcloud/trunk: CHANGES libcloud/compute/drivers/openstack.py test/compute/fixtures/openstack/v1_slug_images_detail.xml test/compute/fixtures/openstack_v1.1/_images_13.json test/compute/test_openstack.py
Date Thu, 08 Mar 2012 18:24:08 GMT
Author: tomaz
Date: Thu Mar  8 18:24:07 2012
New Revision: 1298491

URL: http://svn.apache.org/viewvc?rev=1298491&view=rev
Log:
Include 'minRam' and 'minDisk' attribute in the OpenStack 1.1 driver 
Node extra dictionary. This patch has been contributed by Chris Gilmer and is
part of LIBCLOUD-163.

Modified:
    libcloud/trunk/CHANGES
    libcloud/trunk/libcloud/compute/drivers/openstack.py
    libcloud/trunk/test/compute/fixtures/openstack/v1_slug_images_detail.xml
    libcloud/trunk/test/compute/fixtures/openstack_v1.1/_images_13.json
    libcloud/trunk/test/compute/test_openstack.py

Modified: libcloud/trunk/CHANGES
URL: http://svn.apache.org/viewvc/libcloud/trunk/CHANGES?rev=1298491&r1=1298490&r2=1298491&view=diff
==============================================================================
--- libcloud/trunk/CHANGES (original)
+++ libcloud/trunk/CHANGES Thu Mar  8 18:24:07 2012
@@ -26,6 +26,10 @@ Changes with Apache Libcloud in developm
       ; LIBCLOUD-155
       [Chris Gilmer]
 
+    - Include 'minRam' and 'minDisk' attribute in the OpenStack 1.1 driver 
+      Node extra dictionary. ; LIBCLOUD-163
+      [Chris Gilmer]
+
     - Alow users to use a list of tuples for the query string parameters inside
       the OpenStack connection classes. This way same key can be specified
       multiple times ; LIBCLOUD-153

Modified: libcloud/trunk/libcloud/compute/drivers/openstack.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/compute/drivers/openstack.py?rev=1298491&r1=1298490&r2=1298491&view=diff
==============================================================================
--- libcloud/trunk/libcloud/compute/drivers/openstack.py (original)
+++ libcloud/trunk/libcloud/compute/drivers/openstack.py Thu Mar  8 18:24:07 2012
@@ -309,7 +309,9 @@ class OpenStack_1_0_NodeDriver(OpenStack
                              'created': element.get('created'),
                              'status': element.get('status'),
                              'serverId': element.get('serverId'),
-                             'progress': element.get('progress')})
+                             'progress': element.get('progress'),
+                             'minDisk': element.get('minDisk'),
+                             'minRam': element.get('minRam')})
 
     def _change_password_or_name(self, node, name=None, password=None):
         uri = '/servers/%s' % (node.id)
@@ -855,6 +857,8 @@ class OpenStack_1_1_NodeDriver(OpenStack
                                  progress=api_image.get('progress'),
                                  metadata=api_image.get('metadata'),
                                  serverId=server.get('id'),
+                                 minDisk=api_image.get('minDisk'),
+                                 minRam=api_image.get('minRam'),
                       )
                   )
 

Modified: libcloud/trunk/test/compute/fixtures/openstack/v1_slug_images_detail.xml
URL: http://svn.apache.org/viewvc/libcloud/trunk/test/compute/fixtures/openstack/v1_slug_images_detail.xml?rev=1298491&r1=1298490&r2=1298491&view=diff
==============================================================================
--- libcloud/trunk/test/compute/fixtures/openstack/v1_slug_images_detail.xml (original)
+++ libcloud/trunk/test/compute/fixtures/openstack/v1_slug_images_detail.xml Thu Mar  8 18:24:07
2012
@@ -11,5 +11,5 @@
   <image status="ACTIVE" created="2009-07-20T09:14:37-05:00" updated="2009-07-20T09:14:37-05:00"
name="Ubuntu 8.10 (intrepid)" id="11"/>
   <image status="ACTIVE" created="2009-07-20T09:14:37-05:00" updated="2009-07-20T09:14:37-05:00"
name="Red Hat EL 5.3" id="12"/>
   <image status="ACTIVE" created="2009-07-20T09:14:37-05:00" updated="2009-07-20T09:14:37-05:00"
name="Fedora 11 (Leonidas)" id="13"/>
-  <image status="ACTIVE" progress="100" created="2009-11-29T20:22:09-06:00" updated="2009-11-29T20:24:08-06:00"
serverId="91221" name="daily" id="191234"/>
+  <image status="ACTIVE" progress="100" created="2009-11-29T20:22:09-06:00" updated="2009-11-29T20:24:08-06:00"
serverId="91221" name="daily" id="191234" minDisk="5" minRam="256"/>
 </images>

Modified: libcloud/trunk/test/compute/fixtures/openstack_v1.1/_images_13.json
URL: http://svn.apache.org/viewvc/libcloud/trunk/test/compute/fixtures/openstack_v1.1/_images_13.json?rev=1298491&r1=1298490&r2=1298491&view=diff
==============================================================================
--- libcloud/trunk/test/compute/fixtures/openstack_v1.1/_images_13.json (original)
+++ libcloud/trunk/test/compute/fixtures/openstack_v1.1/_images_13.json Thu Mar  8 18:24:07
2012
@@ -1 +1 @@
-{"image": {"status": "ACTIVE", "updated": "2011-08-06T18:14:02Z", "name": "Windows 2008 SP2
x86 (B24)", "links": [{"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/v1.1/rs-reach-project/images/13",
"rel": "self"}, {"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/rs-reach-project/images/13",
"rel": "bookmark"}, {"href": "http://10.13.136.245:9292/rs-reach-project/images/13", "type":
"application/vnd.openstack.image", "rel": "alternate"}], "created": "2011-08-06T18:13:11Z",
"minDisk": 0, "progress": 100, "minRam": 0, "id": "13", "metadata": {"os_type": "windows"}}}
+{"image": {"status": "ACTIVE", "updated": "2011-08-06T18:14:02Z", "name": "Windows 2008 SP2
x86 (B24)", "links": [{"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/v1.1/rs-reach-project/images/13",
"rel": "self"}, {"href": "http://alpha.ord.servers.api.rackspacecloud.com:8774/rs-reach-project/images/13",
"rel": "bookmark"}, {"href": "http://10.13.136.245:9292/rs-reach-project/images/13", "type":
"application/vnd.openstack.image", "rel": "alternate"}], "created": "2011-08-06T18:13:11Z",
"minDisk": "5", "progress": 100, "minRam": "256", "id": "13", "metadata": {"os_type": "windows"}}}

Modified: libcloud/trunk/test/compute/test_openstack.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/test/compute/test_openstack.py?rev=1298491&r1=1298490&r2=1298491&view=diff
==============================================================================
--- libcloud/trunk/test/compute/test_openstack.py (original)
+++ libcloud/trunk/test/compute/test_openstack.py Thu Mar  8 18:24:07 2012
@@ -171,12 +171,16 @@ class OpenStack_1_0_Tests(unittest.TestC
                          'status': 'ACTIVE',
                          'created': '2009-07-20T09:14:37-05:00',
                          'updated': '2009-07-20T09:14:37-05:00',
-                         'progress': None},
+                         'progress': None,
+                         'minDisk': None,
+                         'minRam': None},
                     11: {'serverId': '91221',
                          'status': 'ACTIVE',
                          'created': '2009-11-29T20:22:09-06:00',
                          'updated': '2009-11-29T20:24:08-06:00',
-                         'progress': '100'}}
+                         'progress': '100',
+                         'minDisk': '5',
+                         'minRam': '256'}}
         for ret_idx, extra in list(expected.items()):
             for key, value in list(extra.items()):
                 self.assertEqual(ret[ret_idx].extra[key], value)
@@ -602,6 +606,8 @@ class OpenStack_1_1_Tests(unittest.TestC
         self.assertEqual(image.extra['status'], 'ACTIVE')
         self.assertEqual(image.extra['metadata']['os_type'], 'windows')
         self.assertEqual(image.extra['serverId'], '52415800-8b69-11e0-9b19-734f335aa7b3')
+        self.assertEqual(image.extra['minDisk'], 0)
+        self.assertEqual(image.extra['minRam'], 0)
 
     def test_create_node(self):
         image = NodeImage(id=11, name='Ubuntu 8.10 (intrepid)', driver=self.driver)
@@ -718,6 +724,8 @@ class OpenStack_1_1_Tests(unittest.TestC
         self.assertEqual(image.id, image_id)
         self.assertEqual(image.name, 'Windows 2008 SP2 x86 (B24)')
         self.assertEqual(image.extra['serverId'], None)
+        self.assertEqual(image.extra['minDisk'], "5")
+        self.assertEqual(image.extra['minRam'], "256")
 
     def test_ex_delete_image(self):
         image = NodeImage(id='26365521-8c62-11f9-2c33-283d153ecc3a', name='My Backup', driver=self.driver)



Mime
View raw message