From 23990a3f397b508cb2fd049ae23b1d019a692335 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Mon, 23 Jan 2012 16:10:09 +0000 Subject: API version check cleanups nova/api/openstack/auth.py: Remove the redundant version check. nova/openstack/common.py: Fixup the comments to match the code Change-Id: I2514da854afb55d67d24adf76b227ef5a70814b9 --- nova/api/openstack/auth.py | 8 +++----- nova/api/openstack/common.py | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'nova/api') 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' -- cgit