Comment 1 for bug 904072

Vish Ishaya (vishvananda) wrote :

fix is pretty easy, but fixing the tests afterwards is really annoying.

diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py
index 1ffca9e..5760f88 100644
--- a/nova/api/openstack/wsgi.py
+++ b/nova/api/openstack/wsgi.py
@@ -560,8 +560,10 @@ class Resource(wsgi.Application):
             return Fault(webob.exc.HTTPBadRequest(explanation=msg))

         project_id = args.pop("project_id", None)
- if 'nova.context' in request.environ and project_id:
- request.environ['nova.context'].project_id = project_id
+ if ('nova.context' in request.environ and project_id
+ and project_id != request.environ['nova.context'].project_id):
+ msg = _("Malformed request url")
+ return Fault(webob.exc.HTTPBadRequest(explanation=msg))

         try:
             action_result = self.dispatch(request, action, args)