From d9d5e226c9e9b9ac3b0f78d69e1d41f9c2f188e5 Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Mon, 25 Jan 2016 15:35:04 -0800 Subject: [PATCH] NSX|V: ensure that DHCP bindings are deleted There are cases where a DHCP binding may not be deleted. This is when for example a nova boot does not succeed. The plugin would only delete the binding if the device owner was 'compute'. But nova may reset that data and the binding on the backend may never get deleted. The code also validates that a binding entry exists. If it does then it will send a message to the NSX. Change-Id: Icb0fec03e67dad97329b9d57c67d7398bd52a86b --- vmware_nsx/plugins/nsx_v/plugin.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/vmware_nsx/plugins/nsx_v/plugin.py b/vmware_nsx/plugins/nsx_v/plugin.py index cc885f29de..8f6ec5c9af 100644 --- a/vmware_nsx/plugins/nsx_v/plugin.py +++ b/vmware_nsx/plugins/nsx_v/plugin.py @@ -276,11 +276,9 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin, def _delete_dhcp_static_binding(self, context, neutron_port_db): network_id = neutron_port_db['network_id'] - device_owner = neutron_port_db['device_owner'] - if device_owner.startswith("compute"): - self.edge_manager.delete_dhcp_binding( - context, neutron_port_db['id'], network_id, - neutron_port_db['mac_address']) + self.edge_manager.delete_dhcp_binding( + context, neutron_port_db['id'], network_id, + neutron_port_db['mac_address']) def _validate_provider_create(self, context, network): if not attr.is_attr_set(network.get(mpnet.SEGMENTS)):