diff options
| author | Pádraig Brady <pbrady@redhat.com> | 2012-01-23 16:10:09 +0000 |
|---|---|---|
| committer | Pádraig Brady <pbrady@redhat.com> | 2012-01-23 16:14:30 +0000 |
| commit | 23990a3f397b508cb2fd049ae23b1d019a692335 (patch) | |
| tree | 28a4b79a83c0024752da64ecb3ac0914470eb1b5 /nova | |
| parent | b3a41b7229ae785af8f35910d0decede03f2ff2b (diff) | |
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
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/api/openstack/auth.py | 8 | ||||
| -rw-r--r-- | nova/api/openstack/common.py | 4 |
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' |
