diff --git a/vmware_nsx/plugins/nsx_v/plugin.py b/vmware_nsx/plugins/nsx_v/plugin.py index 9aa5ce2d93..7158f729ca 100644 --- a/vmware_nsx/plugins/nsx_v/plugin.py +++ b/vmware_nsx/plugins/nsx_v/plugin.py @@ -2210,6 +2210,11 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin, self._update_mac_learning_state(context, id, new_mac_learning_state) + # update port security in DB if changed + if psec.PORTSECURITY in port['port']: + self._process_port_port_security_update( + context, port_data, ret_port) + if comp_owner_update: # Create dhcp bindings, the port is now owned by an instance self._create_dhcp_static_binding(context, ret_port) @@ -2255,11 +2260,6 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin, 'device owner [%(dev_own)s] and port %(pid)s', {'dev_own': owner, 'pid': original_port['id']}) - # update port security in DB if changed - if psec.PORTSECURITY in port['port']: - self._process_port_port_security_update( - context, port_data, ret_port) - # Processing compute port update vnic_idx = original_port.get(ext_vnic_idx.VNIC_INDEX) if validators.is_attr_set(vnic_idx) and is_compute_port: