summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/auth.py8
-rw-r--r--nova/api/openstack/common.py4
2 files changed, 5 insertions, 7 deletions
diff --git a/nova/api/openstack/auth.py b/nova/api/openstack/auth.py
index 9a0432d51..8e0a71d4f 100644
--- a/nova/api/openstack/auth.py
+++ b/nova/api/openstack/auth.py
@@ -240,11 +240,9 @@ class AuthMiddleware(base_wsgi.Middleware):
token_dict = {}
token_dict['token_hash'] = token_hash
token_dict['cdn_management_url'] = ''
- os_url = req.url
- token_dict['server_management_url'] = os_url.strip('/')
- version = common.get_version_from_href(os_url)
- if version in ('1.1', '2'):
- token_dict['server_management_url'] += '/' + project_id
+ os_url = req.url.strip('/')
+ os_url += '/' + project_id
+ token_dict['server_management_url'] = os_url
token_dict['storage_url'] = ''
token_dict['user_id'] = user.id
token = self.db.auth_token_create(ctxt, token_dict)
diff --git a/nova/api/openstack/common.py b/nova/api/openstack/common.py
index 0ac46d96e..855af7025 100644
--- a/nova/api/openstack/common.py
+++ b/nova/api/openstack/common.py
@@ -250,10 +250,10 @@ def get_version_from_href(href):
"""Returns the api version in the href.
Returns the api version in the href.
- If no version is found, 1.0 is returned
+ If no version is found, '2' is returned
Given: 'http://www.nova.com/123'
- Returns: '1.0'
+ Returns: '2'
Given: 'http://www.nova.com/v1.1'
Returns: '1.1'