NSX|V3: treat missing exclude list entry on delete

Ensure that there is not an exception with port deletion if the
port is not in the exclude list.

Change-Id: If9fcfba56fb0af13993c051ea2c38e9d5b915ae4
This commit is contained in:
Gary Kotton 2017-05-10 19:08:45 -07:00 committed by garyk
parent b440057ed6
commit f0c1570025
1 changed files with 5 additions and 1 deletions

View File

@ -2006,7 +2006,11 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
port.get(ext_sg.SECURITYGROUPS, []), [])
if self._is_excluded_port(port.get('device_owner'),
port.get('port_security_enabled')):
self.nsxlib.remove_member_from_exclude_list(nsx_port_id)
try:
self.nsxlib.remove_member_from_exclude_list(nsx_port_id)
except Exception as e:
LOG.warning(_LW("Unable to remove port from exclude list. "
"Reason: %s"), e)
self.disassociate_floatingips(context, port_id)
# Remove Mac/IP binding from native DHCP server and neutron DB.