NSX|P: Allow removing segment port address bindings

Change-Id: Ic648f25850266a5e8d9e81f5857e2322692acd1e
This commit is contained in:
asarfaty 2021-01-27 10:44:33 +02:00
parent 2f49527e3e
commit 146ad05090

View File

@ -600,10 +600,8 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
def _net_nsx_name(self, network): def _net_nsx_name(self, network):
name = utils.get_name_and_uuid(network.get('name') or 'network', name = utils.get_name_and_uuid(network.get('name') or 'network',
network['id']) network['id'])
LOG.error("DEBUG ADIT orig name = %s", name)
# remove illegal characters in segment names: ;|=,~@' # remove illegal characters in segment names: ;|=,~@'
name = re.sub("[;|=,~@\']", '', name) name = re.sub("[;|=,~@\']", '', name)
LOG.error("DEBUG ADIT fixed name = %s", name)
return name return name
def _create_network_on_backend(self, context, net_data, def _create_network_on_backend(self, context, net_data,
@ -1601,7 +1599,8 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
psec_on, has_ip = self._determine_port_security_and_has_ip(context, psec_on, has_ip = self._determine_port_security_and_has_ip(context,
port_data) port_data)
if not psec_on: if not psec_on:
return None # returning an empty list will delete all existing bindings
return []
address_bindings = [] address_bindings = []
for fixed_ip in port_data['fixed_ips']: for fixed_ip in port_data['fixed_ips']: