summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorSirisha Devineni <sirisha_devineni@persistent.co.in>2012-09-28 21:33:49 +0530
committerSirisha Devineni <sirisha_devineni@persistent.co.in>2012-10-03 16:25:40 +0530
commit5b0494f877ec1cb95bb18b8608a341c21109832f (patch)
tree463cfb5ec81f928f1943343d91f3cea895bd8a0e /nova/api
parent3cb3db034ddf9a2b82ebd87b2ba612ab779f63be (diff)
Return proper error messages while associating floating IP
Handled the FloatingIpNotFoundForAddress, NotAuthorized exceptions raised while associating floating IPs which are not allocated or allocated to another project. Fixes bug 1057906 Change-Id: I2d6eba9159b4e855fe615ed4dfa23c388d28c6d0
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/contrib/floating_ips.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/nova/api/openstack/compute/contrib/floating_ips.py b/nova/api/openstack/compute/contrib/floating_ips.py
index 1c17591a4..67d52b9ca 100644
--- a/nova/api/openstack/compute/contrib/floating_ips.py
+++ b/nova/api/openstack/compute/contrib/floating_ips.py
@@ -259,7 +259,8 @@ class FloatingIPActionController(wsgi.Controller):
except exception.NoFloatingIpInterface:
msg = _('l3driver call to add floating ip failed')
raise webob.exc.HTTPBadRequest(explanation=msg)
- except exception.FloatingIpNotFoundForAddress:
+ except (exception.FloatingIpNotFoundForAddress,
+ exception.NotAuthorized):
msg = _('floating ip not found')
raise webob.exc.HTTPNotFound(explanation=msg)
except Exception: