Permalink
Browse files

Merge pull request #1 from emonty/uk

Add support for UK servers.
  • Loading branch information...
2 parents 4fef0b5 + 8c9c3d0 commit 08837565c3af37bd5812935e42a499f455eba868 @emonty committed Aug 1, 2012
Showing with 25 additions and 6 deletions.
  1. +19 −4 rackspace_auth_openstack/plugin.py
  2. +6 −2 setup.py
@@ -14,17 +14,32 @@
# under the License.
-def auth_url():
- """Return the Rackspace Cloud Auth URL"""
+def auth_url_us():
+ """Return the Rackspace Cloud US Auth URL"""
return "https://identity.api.rackspacecloud.com/v2.0/"
-def authenticate(cls,
- auth_url=auth_url()):
+def auth_url_uk():
+ """Return the Rackspace Cloud UK Auth URL"""
+ return "https://lon.identity.api.rackspacecloud.com/v2.0/"
+
+
+def _authenticate(cls, auth_url):
"""Authenticate against the Rackspace auth service."""
body = {"auth": {
"RAX-KSKEY:apiKeyCredentials": {
"username": cls.user,
"apiKey": cls.password,
"tenantName": cls.projectid}}}
return cls._authenticate(auth_url, body)
+
+
+def authenticate_us(cls,
+ auth_url=auth_url_us()):
+ """Authenticate against the Rackspace US auth service."""
+ return _authenticate(cls, auth_url)
+
+def authenticate_uk(cls,
+ auth_url=auth_url_uk()):
+ """Authenticate against the Rackspace UK auth service."""
+ return _authenticate(cls, auth_url)
View
@@ -42,10 +42,14 @@ def read_file(file_name):
],
entry_points={
"openstack.client.auth_url": [
- "rackspace = rackspace_auth_openstack.plugin:auth_url"
+ "rackspace_us = rackspace_auth_openstack.plugin:auth_url_us",
+ "rackspace_uk = rackspace_auth_openstack.plugin:auth_url_uk",
+ "rackspace = rackspace_auth_openstack.plugin:auth_url_us"
],
"openstack.client.authenticate": [
- "rackspace = rackspace_auth_openstack.plugin:authenticate"
+ "rackspace_us = rackspace_auth_openstack.plugin:authenticate_us",
+ "rackspace_uk = rackspace_auth_openstack.plugin:authenticate_uk",
+ "rackspace = rackspace_auth_openstack.plugin:authenticate_us"
]
}
)

0 comments on commit 0883756

Please sign in to comment.