From 5b0494f877ec1cb95bb18b8608a341c21109832f Mon Sep 17 00:00:00 2001 From: Sirisha Devineni Date: Fri, 28 Sep 2012 21:33:49 +0530 Subject: 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 --- nova/api/openstack/compute/contrib/floating_ips.py | 3 ++- 1 file changed, 2 insertions(+), 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 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: -- cgit