NSX|V: don't fail port deletion if static binding deletion fails

The static binding may have been deleted by another process, admin
utility or manually. The port deletion should not fail on this.

Change-Id: I44763629f66f65904b1d2990265160b41d8bc212
Closes-bug: #1596812
(cherry picked from commit de76ea7fa5)
This commit is contained in:
Gary Kotton 2016-06-28 00:08:55 -07:00 committed by garyk
parent 2735c08681
commit d2cca7ccc4
1 changed files with 8 additions and 3 deletions

View File

@ -292,9 +292,14 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
def _delete_dhcp_static_binding(self, context, neutron_port_db):
network_id = neutron_port_db['network_id']
self.edge_manager.delete_dhcp_binding(
context, neutron_port_db['id'], network_id,
neutron_port_db['mac_address'])
try:
self.edge_manager.delete_dhcp_binding(
context, neutron_port_db['id'], network_id,
neutron_port_db['mac_address'])
except Exception as e:
LOG.error(_LE('Unable to delete static bindings for %(id)s. '
'Error: %(e)s'),
{'id': neutron_port_db['id'], 'e': e})
def _validate_provider_create(self, context, network):
if not attr.is_attr_set(network.get(mpnet.SEGMENTS)):