From 064948eb96cd6f585ed18af3966aaba0ff190ae1 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Fri, 2 Nov 2012 15:44:07 -0700 Subject: 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 --- nova/api/openstack/compute/contrib/floating_ips.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nova/api') 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) -- cgit