libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1353047 - in /libcloud/trunk: CHANGES libcloud/compute/drivers/rackspacenova.py libcloud/compute/providers.py libcloud/compute/types.py test/compute/test_rackspacenova.py
Date Fri, 22 Jun 2012 23:59:08 GMT
Author: tomaz
Date: Fri Jun 22 23:59:06 2012
New Revision: 1353047

URL: http://svn.apache.org/viewvc?rev=1353047&view=rev
Log:
Add Rackspace Nova London compute driver. Contributed by Chris Gilmer, part of
LIBCLOUD-218.

Modified:
    libcloud/trunk/CHANGES
    libcloud/trunk/libcloud/compute/drivers/rackspacenova.py
    libcloud/trunk/libcloud/compute/providers.py
    libcloud/trunk/libcloud/compute/types.py
    libcloud/trunk/test/compute/test_rackspacenova.py

Modified: libcloud/trunk/CHANGES
URL: http://svn.apache.org/viewvc/libcloud/trunk/CHANGES?rev=1353047&r1=1353046&r2=1353047&view=diff
==============================================================================
--- libcloud/trunk/CHANGES (original)
+++ libcloud/trunk/CHANGES Fri Jun 22 23:59:06 2012
@@ -58,6 +58,9 @@ Changes with Apache Libcloud in developm
       objects. ; LIBCLOUD-213
       [Gabriel Reid, Tomaz Muraus]
 
+    - Add Rackspace Nova London driver.
+      [Chris Gilmer]
+
   *) DNS
 
     - Add support for GEO RecordType to Zerigo driver. ; LIBCLOUD-203

Modified: libcloud/trunk/libcloud/compute/drivers/rackspacenova.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/compute/drivers/rackspacenova.py?rev=1353047&r1=1353046&r2=1353047&view=diff
==============================================================================
--- libcloud/trunk/libcloud/compute/drivers/rackspacenova.py (original)
+++ libcloud/trunk/libcloud/compute/drivers/rackspacenova.py Fri Jun 22 23:59:06 2012
@@ -56,6 +56,13 @@ class RackspaceNovaDfwConnection(Rackspa
                          'region': 'DFW'}
 
 
+class RackspaceNovaLonConnection(RackspaceNovaConnection):
+
+    get_endpoint_args = {'service_type': 'compute',
+                         'name': 'cloudServersOpenStack',
+                         'region': 'LON'}
+
+
 class RackspaceNovaDfwNodeDriver(OpenStack_1_1_NodeDriver):
     name = 'RackspaceNovadfw'
     website = 'http://www.rackspace.com/'
@@ -64,6 +71,14 @@ class RackspaceNovaDfwNodeDriver(OpenSta
     api_name = 'rackspacenovadfw'
 
 
+class RackspaceNovaLonNodeDriver(OpenStack_1_1_NodeDriver):
+    name = 'RackspaceNovalon'
+    website = 'http://www.rackspace.com/'
+    connectionCls = RackspaceNovaLonConnection
+    type = Provider.RACKSPACE_NOVA_LON
+    api_name = 'rackspacenovalon'
+
+
 class RackspaceNovaBetaNodeDriver(OpenStack_1_1_NodeDriver):
     name = 'RackspaceNovaBeta'
     website = 'http://www.rackspace.com/'

Modified: libcloud/trunk/libcloud/compute/providers.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/compute/providers.py?rev=1353047&r1=1353046&r2=1353047&view=diff
==============================================================================
--- libcloud/trunk/libcloud/compute/providers.py (original)
+++ libcloud/trunk/libcloud/compute/providers.py Fri Jun 22 23:59:06 2012
@@ -111,6 +111,8 @@ DRIVERS = {
         ('libcloud.compute.drivers.rackspacenova', 'RackspaceNovaBetaNodeDriver'),
     Provider.RACKSPACE_NOVA_DFW:
         ('libcloud.compute.drivers.rackspacenova', 'RackspaceNovaDfwNodeDriver'),
+    Provider.RACKSPACE_NOVA_LON:
+        ('libcloud.compute.drivers.rackspacenova', 'RackspaceNovaLonNodeDriver'),
     Provider.LIBVIRT:
         ('libcloud.compute.drivers.libvirt_driver', 'LibvirtNodeDriver'),
     Provider.JOYENT:

Modified: libcloud/trunk/libcloud/compute/types.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/compute/types.py?rev=1353047&r1=1353046&r2=1353047&view=diff
==============================================================================
--- libcloud/trunk/libcloud/compute/types.py (original)
+++ libcloud/trunk/libcloud/compute/types.py Fri Jun 22 23:59:06 2012
@@ -62,6 +62,8 @@ class Provider(object):
     @cvar CLOUDSTACK: CloudStack
     @cvar CLOUDSIGMA_US: CloudSigma US Las Vegas
     @cvar RACKSPACE_NOVA_BETA: Rackspace Nova Private Beta (ORD)
+    @cvar RACKSPACE_NOVA_DFW: Rackspace Nova Private DFW (DFW)
+    @cvar RACKSPACE_NOVA_LON: Rackspace Nova Private LON (LON)
     @cvar LIBVIRT: Libvirt driver
     @cvar JOYENT: Joyent driver
     @cvar VCL: VCL driver
@@ -117,6 +119,7 @@ class Provider(object):
     JOYENT = 45
     VCL = 46
     KTUCLOUD=47
+    RACKSPACE_NOVA_LON = 48
 
 
 class NodeState(object):

Modified: libcloud/trunk/test/compute/test_rackspacenova.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/test/compute/test_rackspacenova.py?rev=1353047&r1=1353046&r2=1353047&view=diff
==============================================================================
--- libcloud/trunk/test/compute/test_rackspacenova.py (original)
+++ libcloud/trunk/test/compute/test_rackspacenova.py Fri Jun 22 23:59:06 2012
@@ -16,9 +16,10 @@ import sys
 import unittest
 
 from libcloud.utils.py3 import method_type
-
+from libcloud.utils.py3 import httplib
 from libcloud.compute.drivers.rackspacenova import RackspaceNovaBetaNodeDriver, \
-                                                   RackspaceNovaDfwNodeDriver
+                                                   RackspaceNovaDfwNodeDriver, \
+                                                   RackspaceNovaLonNodeDriver
 from test.compute.test_openstack import OpenStack_1_1_Tests, OpenStack_1_1_MockHttp
 from libcloud.pricing import clear_pricing_data
 
@@ -40,6 +41,13 @@ class RackspaceNovaMockHttp(OpenStack_1_
                 RackspaceNovaMockHttp))
 
 
+class RackspaceNovaLonMockHttp(RackspaceNovaMockHttp):
+
+    def _v2_0_tokens(self, method, url, body, headers):
+        body = self.auth_fixtures.load('_v2_0__auth_lon.json')
+        return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK])
+
+
 class RackspaceNovaBetaTests(OpenStack_1_1_Tests):
 
     driver_klass = RackspaceNovaBetaNodeDriver
@@ -88,5 +96,29 @@ class RackspaceNovaDfwTests(OpenStack_1_
         self.assertEqual('https://dfw.servers.api.rackspacecloud.com/v2/1337', self.driver.connection.get_endpoint())
 
 
+class RackspaceNovaLonTests(OpenStack_1_1_Tests):
+
+    driver_klass = RackspaceNovaLonNodeDriver
+    driver_type = RackspaceNovaLonNodeDriver
+    driver_args = RACKSPACE_NOVA_PARAMS + ('1.1',)
+    driver_kwargs = {'ex_force_auth_version': '2.0'}
+
+    @classmethod
+    def create_driver(self):
+        return self.driver_type(*self.driver_args, **self.driver_kwargs)
+
+    def setUp(self):
+        self.driver_klass.connectionCls.conn_classes = (RackspaceNovaLonMockHttp, RackspaceNovaLonMockHttp)
+        self.driver_klass.connectionCls.auth_url = "https://lon.auth.api.example.com/v2.0/"
+        self.driver = self.create_driver()
+        # normally authentication happens lazily, but we force it here
+        self.driver.connection._populate_hosts_and_request_paths()
+        clear_pricing_data()
+        self.node = self.driver.list_nodes()[1]
+
+    def test_service_catalog(self):
+        self.assertEqual('https://lon.servers.api.rackspacecloud.com/v2/1337', self.driver.connection.get_endpoint())
+
+
 if __name__ == '__main__':
     sys.exit(unittest.main())



Mime
View raw message