From 17336b9cb64048652bb6853fe0429699b4762a40 Mon Sep 17 00:00:00 2001 From: Aaron Rosen Date: Mon, 6 May 2013 20:21:57 -0700 Subject: [PATCH] Fix 500 raised on disassociate_floatingips when out of sync If one deletes NAT rules directly from NVP and not through quantum, an error will be raised when deleting a port that is associated with the floating ip. This patch catches the NotFound exception and logs it so that the port can successfully be deleted. Fixes bug: 1177176 Change-Id: Ia7d0b94957d0c6b014d242439245b0e4fa9de40d --- quantum/plugins/nicira/QuantumPlugin.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/quantum/plugins/nicira/QuantumPlugin.py b/quantum/plugins/nicira/QuantumPlugin.py index 52879c2a2..80591dde5 100644 --- a/quantum/plugins/nicira/QuantumPlugin.py +++ b/quantum/plugins/nicira/QuantumPlugin.py @@ -1856,6 +1856,9 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, except sa_exc.NoResultFound: LOG.debug(_("The port '%s' is not associated with floating IPs"), port_id) + except q_exc.NotFound: + LOG.warning(_("Nat rules not found in nvp for port: %s"), id) + super(NvpPluginV2, self).disassociate_floatingips(context, port_id) def create_network_gateway(self, context, network_gateway): -- 2.45.2