Updated Branches: refs/heads/0.12.x 428082821 -> 2c815ace3
Add a driver for Rackspace's new datacenter in Sydney, Australia. Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/2c815ace Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/2c815ace Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/2c815ace Branch: refs/heads/0.12.x Commit: 2c815ace3212610430db4144cfa0eaacff8398a6 Parents: 4280828 Author: Tomaz Muraus <[email protected]> Authored: Sat Jun 22 20:37:31 2013 +0200 Committer: Tomaz Muraus <[email protected]> Committed: Sat Jun 22 21:04:18 2013 +0200 ---------------------------------------------------------------------- CHANGES | 3 +++ libcloud/compute/drivers/rackspace.py | 37 ++++++++++++++++++++++++++++-- libcloud/compute/providers.py | 2 ++ libcloud/compute/types.py | 1 + 4 files changed, 41 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/2c815ace/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index d0729ad..bcbfd4c 100644 --- a/CHANGES +++ b/CHANGES @@ -103,6 +103,9 @@ Changes with Apache Libcloud in deveploment: which return a valid SSL certificate. (LIBCLOUD-346) [Bob Thompson] + - Add a driver for Rackspace's new datacenter in Sydney, Australia. + [Alex Gaynor, Tomaz Muraus] + *) Storage - Fix an issue with double encoding the container name in the CloudFiles http://git-wip-us.apache.org/repos/asf/libcloud/blob/2c815ace/libcloud/compute/drivers/rackspace.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/rackspace.py b/libcloud/compute/drivers/rackspace.py index 2f8a329..203a73b 100644 --- a/libcloud/compute/drivers/rackspace.py +++ b/libcloud/compute/drivers/rackspace.py @@ -34,8 +34,8 @@ class RackspaceConnection(OpenStack_1_0_Connection): XML_NAMESPACE = 'http://docs.rackspacecloud.com/servers/api/v1.0' def get_endpoint(self): - ep = {} + if '2.0' in self._auth_version: ep = self.service_catalog.get_endpoint(service_type='compute', name='cloudServers') @@ -74,7 +74,8 @@ class RackspaceUKConnection(RackspaceConnection): class RackspaceUKNodeDriver(RackspaceNodeDriver): - """Driver for Rackspace in the UK (London) + """ + Driver for Rackspace in the UK (London) """ name = 'Rackspace (UK)' @@ -82,3 +83,35 @@ class RackspaceUKNodeDriver(RackspaceNodeDriver): def list_locations(self): return [NodeLocation(0, 'Rackspace UK London', 'UK', self)] + + +class RackspaceAUConnection(RackspaceConnection): + """ + Connection class for the Rackspace Sydney datacenter + """ + + auth_url = AUTH_URL_US + _auth_version = '2.0' + + def get_endpoint(self): + ep = {} + + ep = self.service_catalog.get_endpoint(service_type='compute', + name='cloudServersOpenStack', + region='SYD') + + if 'publicURL' in ep: + return ep['publicURL'] + + raise LibcloudError('Could not find specified endpoint') + + +class RackspaceAUNodeDriver(RackspaceNodeDriver): + """Driver for Rackspace in the UK (London) + """ + + name = 'Rackspace (Sydney, Australia)' + connectionCls = RackspaceAUConnection + + def list_locations(self): + return [NodeLocation(0, 'Rackspace Sydney, Australia', 'AU', self)] http://git-wip-us.apache.org/repos/asf/libcloud/blob/2c815ace/libcloud/compute/providers.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/providers.py b/libcloud/compute/providers.py index 8e23f4f..54f0aa9 100644 --- a/libcloud/compute/providers.py +++ b/libcloud/compute/providers.py @@ -70,6 +70,8 @@ DRIVERS = { ('libcloud.compute.drivers.rackspace', 'RackspaceNodeDriver'), Provider.RACKSPACE_UK: ('libcloud.compute.drivers.rackspace', 'RackspaceUKNodeDriver'), + Provider.RACKSPACE_AU: + ('libcloud.compute.drivers.rackspace', 'RackspaceAUNodeDriver'), Provider.SLICEHOST: ('libcloud.compute.drivers.slicehost', 'SlicehostNodeDriver'), Provider.VPSNET: http://git-wip-us.apache.org/repos/asf/libcloud/blob/2c815ace/libcloud/compute/types.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/types.py b/libcloud/compute/types.py index dabe50e..2f076cd 100644 --- a/libcloud/compute/types.py +++ b/libcloud/compute/types.py @@ -124,6 +124,7 @@ class Provider(object): RACKSPACE = 'rackspace' RACKSPACE_UK = 'rackspace_uk' + RACKSPACE_AU = 'rackspace_au' RACKSPACE_NOVA_BETA = 'rackspace_nova_beta' RACKSPACE_NOVA_DFW = 'rackspace_nova_dfw' RACKSPACE_NOVA_LON = 'rackspace_nova_lon'
