diff options
| author | Vishvananda Ishaya <vishvananda@gmail.com> | 2012-01-12 14:27:50 -0800 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2012-01-12 16:53:17 -0800 |
| commit | fd3cad62732afddec6708f330b1ce967349125b0 (patch) | |
| tree | 5068617f841a209c79654af3378980e73de373e2 /nova/api | |
| parent | 6f2bf0994aabb110325491b8e6d6e929fb83c37f (diff) | |
Make authz failures use proper response code
* Improvement for blueprint interim-nova-authz-service
* Added tests to verify raise
Change-Id: Ibf6bc3327abab1f3ae752aa350f1628c67b03260
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/wsgi.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py index 2bd6fa817..f8790d9f0 100644 --- a/nova/api/openstack/wsgi.py +++ b/nova/api/openstack/wsgi.py @@ -840,6 +840,9 @@ class Resource(wsgi.Application): response = None try: action_result = self.dispatch(meth, request, action_args) + except exception.NotAuthorized as ex: + msg = unicode(ex) + response = Fault(webob.exc.HTTPUnauthorized(explanation=msg)) except TypeError as ex: LOG.exception(ex) response = Fault(webob.exc.HTTPBadRequest()) |
