diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-01-24 06:57:52 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-01-24 06:57:52 +0000 |
| commit | b8f78573138ef74ebff0d28f480f5f84e3d7a7d3 (patch) | |
| tree | d3dc6b1565773f04883fcc49453fb8f640557727 /nova/api | |
| parent | b160d731b5dff65ba887578ad8fe4d7403426613 (diff) | |
| parent | 23990a3f397b508cb2fd049ae23b1d019a692335 (diff) | |
| download | nova-b8f78573138ef74ebff0d28f480f5f84e3d7a7d3.tar.gz nova-b8f78573138ef74ebff0d28f480f5f84e3d7a7d3.tar.xz nova-b8f78573138ef74ebff0d28f480f5f84e3d7a7d3.zip | |
Merge "API version check cleanups"
Diffstat (limited to 'nova/api')
| -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 2cc18661b..15f5be737 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' |
