From 477dac0373b5e84c71365d7a71b9cc41aafcb491 Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Wed, 16 Oct 2013 15:11:34 -0700 Subject: [PATCH] nvp:log only in rm router iface if port not found The code currently raises when it's not able to find the port to be deleted on the backend. This might happen, for instance, when the port is manually removed or, in some cases, if port creation failed in the first place. There's little sense in raising when a resource to be removed is not found; therefore this patch replaces the raise statement with a log statement. Bug 1240720 Change-Id: Ifa756b07ef41346a44325341c8e0e8994dc64dde --- neutron/plugins/nicira/NeutronPlugin.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/neutron/plugins/nicira/NeutronPlugin.py b/neutron/plugins/nicira/NeutronPlugin.py index ec791f289..f9d84d2fd 100644 --- a/neutron/plugins/nicira/NeutronPlugin.py +++ b/neutron/plugins/nicira/NeutronPlugin.py @@ -520,8 +520,12 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin, nvp_port_id = self._nvp_get_port_id(context, self.cluster, port_data) if not nvp_port_id: - raise q_exc.PortNotFound(port_id=port_data['id']) - + LOG.warn(_("Neutron port %(port_id)s not found on NVP backend. " + "Terminating delete operation. A dangling router port " + "might have been left on router %(router_id)s"), + {'port_id': port_data['id'], + 'router_id': lrouter_id}) + return try: nvplib.delete_peer_router_lport(self.cluster, lrouter_id, -- 2.45.2