summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Waldon <bcwaldon@gmail.com>2012-01-25 10:37:33 -0800
committerBrian Waldon <bcwaldon@gmail.com>2012-01-25 10:37:33 -0800
commit4a04d297bdd276b7bd9fbd1565c9c7dcfc87ee95 (patch)
tree6cf075e16e0815d13ba862b336ac35b07d0c5d67
parentfcf73f90c37c53fc7743134f6088b3efca52485e (diff)
downloadnova-4a04d297bdd276b7bd9fbd1565c9c7dcfc87ee95.tar.gz
nova-4a04d297bdd276b7bd9fbd1565c9c7dcfc87ee95.tar.xz
nova-4a04d297bdd276b7bd9fbd1565c9c7dcfc87ee95.zip
Return 403 instead of 401 when policies reject
Fixes bug 921744 Change-Id: Ib4b6405dffa3ee2e8ef2b8a7710124f97f0fdf43
-rw-r--r--nova/api/openstack/wsgi.py2
-rw-r--r--nova/tests/api/openstack/test_wsgi.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py
index 8a7a077b8..26f6cc97f 100644
--- a/nova/api/openstack/wsgi.py
+++ b/nova/api/openstack/wsgi.py
@@ -573,7 +573,7 @@ class ResourceExceptionHandler(object):
if isinstance(ex_value, exception.NotAuthorized):
msg = unicode(ex_value)
- raise Fault(webob.exc.HTTPUnauthorized(explanation=msg))
+ raise Fault(webob.exc.HTTPForbidden(explanation=msg))
elif isinstance(ex_value, TypeError):
LOG.exception(ex_value)
raise Fault(webob.exc.HTTPBadRequest())
diff --git a/nova/tests/api/openstack/test_wsgi.py b/nova/tests/api/openstack/test_wsgi.py
index 3dfcb2388..3974971fa 100644
--- a/nova/tests/api/openstack/test_wsgi.py
+++ b/nova/tests/api/openstack/test_wsgi.py
@@ -204,7 +204,7 @@ class ResourceTest(test.TestCase):
req = webob.Request.blank('/tests')
app = fakes.TestRouter(Controller())
response = req.get_response(app)
- self.assertEqual(response.status_int, 401)
+ self.assertEqual(response.status_int, 403)
def test_dispatch(self):
class Controller(object):