From 5ffc162a145d8c8e8e1c64780dd3b39efd978f90 Mon Sep 17 00:00:00 2001 From: asarfaty Date: Tue, 31 Mar 2020 15:30:06 +0200 Subject: [PATCH] NSX|V3+P: allow network deletion in case DHCP port not found Change-Id: I3b924a78d5209bfb60f80a86b57ff64a72b947ea --- vmware_nsx/plugins/common_v3/plugin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vmware_nsx/plugins/common_v3/plugin.py b/vmware_nsx/plugins/common_v3/plugin.py index 9bb620ad78..aec0bee0ab 100644 --- a/vmware_nsx/plugins/common_v3/plugin.py +++ b/vmware_nsx/plugins/common_v3/plugin.py @@ -1657,8 +1657,10 @@ class NsxPluginV3Base(agentschedulers_db.AZDhcpAgentSchedulerDbMixin, context.session, dhcp_service['port_id']) self._cleanup_port(context, dhcp_service['port_id'], nsx_port_id) - except nsx_lib_exc.ResourceNotFound: - # This could happen when the port has been manually deleted. + except (nsx_lib_exc.ResourceNotFound, n_exc.NotFound): + # This could happen when the port has been manually deleted + # from the NSX, or when the neutron port deletion previously + # failed LOG.error("Failed to delete DHCP port %(port)s for " "network %(network)s", {'port': dhcp_service['port_id'],