Use "replace" to remove a section of a string
From "strip" documentation: Return a copy of the string with leading whitespace removed. If chars is given and not None, remove characters in chars instead. Change-Id: Ia1bf0a98b327b4deaa4ff87da79b70d27314434a Closes-Bug: #1888828
This commit is contained in:
parent
805b10561e
commit
fc5a8ee1b8
neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb
@ -617,7 +617,7 @@ class DBInconsistenciesPeriodics(SchemaAwarePeriodicsBase):
|
|||||||
admin_context = n_context.get_admin_context()
|
admin_context = n_context.get_admin_context()
|
||||||
cmds = []
|
cmds = []
|
||||||
for ls in self._nb_idl.ls_list().execute(check_error=True):
|
for ls in self._nb_idl.ls_list().execute(check_error=True):
|
||||||
network_id = ls.name.strip('neutron-')
|
network_id = ls.name.replace('neutron-', '')
|
||||||
legacy_name = utils.ovn_provnet_port_name(network_id)
|
legacy_name = utils.ovn_provnet_port_name(network_id)
|
||||||
legacy_port = None
|
legacy_port = None
|
||||||
segment_id = None
|
segment_id = None
|
||||||
|
@ -570,7 +570,7 @@ class OVNClient(object):
|
|||||||
|
|
||||||
ovn_network_name = ovn_port.external_ids.get(
|
ovn_network_name = ovn_port.external_ids.get(
|
||||||
ovn_const.OVN_NETWORK_NAME_EXT_ID_KEY)
|
ovn_const.OVN_NETWORK_NAME_EXT_ID_KEY)
|
||||||
network_id = ovn_network_name.strip('neutron-')
|
network_id = ovn_network_name.replace('neutron-', '')
|
||||||
|
|
||||||
with self._nb_idl.transaction(check_error=True) as txn:
|
with self._nb_idl.transaction(check_error=True) as txn:
|
||||||
txn.add(self._nb_idl.delete_lswitch_port(
|
txn.add(self._nb_idl.delete_lswitch_port(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user