[openstack-nova] fix v1.0 API bug causing a deltacloud regression (#783878)

Pádraig Brady pbrady at fedoraproject.org
Mon Jan 23 22:06:05 UTC 2012


commit 467ad895bdafa3c8b314be1c50b58217b91b5d96
Author: Pádraig Brady <P at draigBrady.com>
Date:   Mon Jan 23 22:01:51 2012 +0000

    fix v1.0 API bug causing a deltacloud regression (#783878)
    
    Copy in the patch from upstream Diablo/Stable

 ...x-X-Server-Management-Url-for-v1.0-noauth.patch |   47 ++++++++++++++++++++
 openstack-nova.spec                                |    5 ++
 2 files changed, 52 insertions(+), 0 deletions(-)
---
diff --git a/0011-Bug-920497-fix-X-Server-Management-Url-for-v1.0-noauth.patch b/0011-Bug-920497-fix-X-Server-Management-Url-for-v1.0-noauth.patch
new file mode 100644
index 0000000..7c71ccd
--- /dev/null
+++ b/0011-Bug-920497-fix-X-Server-Management-Url-for-v1.0-noauth.patch
@@ -0,0 +1,47 @@
+From e48106a2a5086c933d98043952d63c50c25df10b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?P=C3=A1draig=20Brady?= <pbrady at 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 at gmail.com>
+ Nikolay Sokolov <nsokolov at griddynamics.com>
+ Nirmal Ranganathan <nirmal.ranganathan at rackspace.com>
+ Ollie Leahy <oliver.leahy at hp.com>
++Pádraig Brady <pbrady at redhat.com>
+ Paul Voccio <paul at openstack.org>
+ Renuka Apte <renuka.apte at citrix.com>
+ Ricardo Carrillo Cruz <emaildericky at 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
+-- 
+1.7.6.4
+
diff --git a/openstack-nova.spec b/openstack-nova.spec
index a0a0584..2005ed5 100644
--- a/openstack-nova.spec
+++ b/openstack-nova.spec
@@ -37,6 +37,7 @@ Source23:         openstack-nova-db-setup
 #
 
 # These are from stable/diablo
+Patch11:          0011-Bug-920497-fix-X-Server-Management-Url-for-v1.0-noauth.patch
 
 # These are Fedora specific backports from master
 Patch01:          0001-Add-INPUT-chain-rule-for-EC2-metadata-requests-lp-85.patch
@@ -191,6 +192,7 @@ This package contains documentation files for nova.
 %patch08 -p1
 %patch09 -p1
 %patch10 -p1
+%patch11 -p1
 
 find . \( -name .gitignore -o -name .placeholder \) -delete
 
@@ -377,6 +379,9 @@ fi
 %endif
 
 %changelog
+* Fri Jan 20 2012 Pádraig Brady <P at draigBrady.com> - 2011.3.1-2
+- Fix a REST API v1.0 bug causing a regression with deltacloud
+
 * Fri Jan 20 2012 Pádraig Brady <P at draigBrady.com> - 2011.3.1-1
 - Update to 2011.3.1 release
 - Allow empty mysql root password in mysql setup script


More information about the scm-commits mailing list