From 6d93dd491df95bccf10ecf8db9b98f862de07383 Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Wed, 4 Nov 2015 23:15:24 -0800 Subject: [PATCH] NSX|V: ensure that spoofguard policy is port update Ensure that the address pair is updated on the backend when a port is updtaed. Change-Id: I026ad59419ca089704ed8d42405f452271e707e3 --- vmware_nsx/plugins/nsx_v/plugin.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vmware_nsx/plugins/nsx_v/plugin.py b/vmware_nsx/plugins/nsx_v/plugin.py index 924e656225..88864ba0ae 100644 --- a/vmware_nsx/plugins/nsx_v/plugin.py +++ b/vmware_nsx/plugins/nsx_v/plugin.py @@ -958,10 +958,10 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin, port['port'], ret_port) + update_assigned_addresses = False if addr_pair.ADDRESS_PAIRS in attrs: - self.update_address_pairs_on_port(context, id, port, - original_port, - ret_port) + update_assigned_addresses = self.update_address_pairs_on_port( + context, id, port, original_port, ret_port) if comp_owner_update: # Create dhcp bindings, the port is now owned by an instance @@ -984,7 +984,8 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin, self._delete_dhcp_static_binding(context, original_port) else: # Update vnic with the newest approved IP addresses - if has_port_security and updates_fixed_ips: + if (has_port_security and + (updates_fixed_ips or update_assigned_addresses)): LOG.debug("Updating vnic port fixed-ips: port %s, vnic " "%s, fixed-ips %s", id, vnic_id, ret_port['fixed_ips'])