diff options
author | Rick Harris <rconradharris@gmail.com> | 2013-05-23 18:03:42 +0000 |
---|---|---|
committer | Rick Harris <rconradharris@gmail.com> | 2013-05-23 18:03:42 +0000 |
commit | 16af39326a81cd545e1235da9c6c9db45b708560 (patch) | |
tree | a075388d5814931b7cdd4be32c13d46a7f6d08fe | |
parent | 6dd1709bcea69ab47a695d42cb1c3d0e7f221ab2 (diff) | |
download | nova-16af39326a81cd545e1235da9c6c9db45b708560.tar.gz nova-16af39326a81cd545e1235da9c6c9db45b708560.tar.xz nova-16af39326a81cd545e1235da9c6c9db45b708560.zip |
Better error message on malformed request url
The existing error message just said 'malformed url' which isn't
super-helpful. The new version expalins that the project ID in the URL is not
matching what's being passed in with the context.
Change-Id: I8e5b71fcd51ab3628425b53356f9671f3a2402c0
-rw-r--r-- | nova/api/openstack/wsgi.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py index 9c5f9855d..32823ae01 100644 --- a/nova/api/openstack/wsgi.py +++ b/nova/api/openstack/wsgi.py @@ -940,7 +940,11 @@ class Resource(wsgi.Application): project_id = action_args.pop("project_id", None) context = request.environ.get('nova.context') if (context and project_id and (project_id != context.project_id)): - msg = _("Malformed request url") + msg = _("Malformed request URL: URL's project_id '%(project_id)s'" + " doesn't match Context's project_id" + " '%(context_project_id)s'") % \ + {'project_id': project_id, + 'context_project_id': context.project_id} return Fault(webob.exc.HTTPBadRequest(explanation=msg)) # Run pre-processing extensions |