From 566f564a60fc5309441d6624fc70389ffc28773f Mon Sep 17 00:00:00 2001 From: Alex Meade Date: Fri, 28 Oct 2011 12:32:47 -0400 Subject: Updated NoAuth to account for requests ending in / Fixes bug 882742 Change-Id: I19d527c5d16f73de2841e9d69872da6979f71886 --- nova/api/openstack/auth.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/auth.py b/nova/api/openstack/auth.py index 6754fea27..d435f8318 100644 --- a/nova/api/openstack/auth.py +++ b/nova/api/openstack/auth.py @@ -16,6 +16,7 @@ # under the License. import hashlib +import os import time import webob.exc @@ -42,12 +43,9 @@ class NoAuthMiddleware(wsgi.Middleware): @webob.dec.wsgify(RequestClass=wsgi.Request) def __call__(self, req): if 'X-Auth-Token' not in req.headers: - os_url = req.url - version = common.get_version_from_href(os_url) user_id = req.headers.get('X-Auth-User', 'admin') project_id = req.headers.get('X-Auth-Project-Id', 'admin') - if version == '1.1': - os_url += '/' + project_id + os_url = os.path.join(req.url, project_id) res = webob.Response() # NOTE(vish): This is expecting and returning Auth(1.1), whereas # keystone uses 2.0 auth. We should probably allow -- cgit