From e48106a2a5086c933d98043952d63c50c25df10b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= <pbrady@redhat.com> Date: Mon, 23 Jan 2012 15:49:08 +0000 Subject: [PATCH] Bug #920497 fix X-Server-Management-Url for v1.0 noauth API This regression was introduced in commit 2aa5bb96, which discounted the v1.0 case Change-Id: I44e03fbea6b79b1c2e2705b1f39e6c7aaaed9265 --- Authors | 1 + nova/api/openstack/auth.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/Authors b/Authors index c8d3d54..49706a1 100644 --- a/Authors +++ b/Authors @@ -103,6 +103,7 @@ Naveed Massjouni <naveedm9@gmail.com> Nikolay Sokolov <nsokolov@griddynamics.com> Nirmal Ranganathan <nirmal.ranganathan@rackspace.com> Ollie Leahy <oliver.leahy@hp.com> +Pádraig Brady <pbrady@redhat.com> Paul Voccio <paul@openstack.org> Renuka Apte <renuka.apte@citrix.com> Ricardo Carrillo Cruz <emaildericky@gmail.com> diff --git a/nova/api/openstack/auth.py b/nova/api/openstack/auth.py index d435f83..d8dbb68 100644 --- a/nova/api/openstack/auth.py +++ b/nova/api/openstack/auth.py @@ -43,9 +43,12 @@ 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') - os_url = os.path.join(req.url, project_id) + if version == '1.1': + os_url = os.path.join(os_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