Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add support for UK servers. #1

Merged
merged 1 commit into from Aug 1, 2012
Jump to file or symbol
Failed to load files and symbols.
+25 −6
Split
@@ -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"
]
}
)