From 8279240ee30d55d127e4d964a9861b721ac7cc74 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Fri, 20 Jan 2012 16:39:41 -0600 Subject: Handle error in associate floating IP (bug 845507) * Raise NoFloatingIpInterface when associate floating IP has an interface that doesn't exist. * Return 500 Internal server Error, indicate only that associate action failed Change-Id: I6b032f7554795de64bce8e669d20269210c62e33 --- nova/api/openstack/compute/contrib/floating_ips.py | 3 +++ 1 file changed, 3 insertions(+) (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 3cfbc0604..ab9dfb8aa 100644 --- a/nova/api/openstack/compute/contrib/floating_ips.py +++ b/nova/api/openstack/compute/contrib/floating_ips.py @@ -206,6 +206,9 @@ class FloatingIPActionController(wsgi.Controller): raise webob.exc.HTTPBadRequest(explanation=e.message) except exception.NotAuthorized, e: raise webob.exc.HTTPUnauthorized() + except rpc.RemoteError: + msg = _("Associate floating ip failed") + raise webob.exc.HTTPInternalServerError(explanation=msg) return webob.Response(status_int=202) -- cgit