summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorBrian Waldon <bcwaldon@gmail.com>2012-11-02 15:44:07 -0700
committerBrian Waldon <bcwaldon@gmail.com>2012-11-06 19:06:57 -0800
commit064948eb96cd6f585ed18af3966aaba0ff190ae1 (patch)
treed6d9df583c47023fc544e3bf829e0b68f9a60faa /nova/api
parenta77c0c50166aac04f0707af25946557fbd43ad44 (diff)
Map NotAuthorized to 403 in floating ips extension
When a NotAuthorized exception is raised in the network manager, it would be presented as an HTTP 401 exception through the floating ips extension. This patch presents it as a 403 instead. Fixes bug 1074505 Change-Id: Idb45c78755a182635ef353bb9ec8b557c8ea9b16
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/contrib/floating_ips.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/nova/api/openstack/compute/contrib/floating_ips.py b/nova/api/openstack/compute/contrib/floating_ips.py
index 56a6a8fad..1d987d5ad 100644
--- a/nova/api/openstack/compute/contrib/floating_ips.py
+++ b/nova/api/openstack/compute/contrib/floating_ips.py
@@ -92,7 +92,7 @@ def disassociate_floating_ip(self, context, instance, address):
try:
self.network_api.disassociate_floating_ip(context, instance, address)
except exception.NotAuthorized:
- raise webob.exc.HTTPUnauthorized()
+ raise webob.exc.HTTPForbidden()
except exception.FloatingIpNotAssociated:
msg = _('Floating ip is not associated')
raise webob.exc.HTTPBadRequest(explanation=msg)