diff --git a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/impl_idl_ovn.py b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/impl_idl_ovn.py index c0673864c4f..822a3b7d6dc 100644 --- a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/impl_idl_ovn.py +++ b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/impl_idl_ovn.py @@ -935,6 +935,7 @@ class OvsdbSbOvnIdl(sb_impl_idl.OvnSbApiIdlImpl, Backend): def get_logical_port_chassis_and_datapath(self, name): for port in self._tables['Port_Binding'].rows.values(): if port.logical_port == name: - datapath = str(port.datapath.uuid) + network_id = utils.get_network_name_from_datapath( + port.datapath) chassis = port.chassis[0].name if port.chassis else None - return chassis, datapath + return chassis, network_id diff --git a/neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_impl_idl.py b/neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_impl_idl.py index ad3cbe9f329..18b35232ede 100644 --- a/neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_impl_idl.py +++ b/neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_impl_idl.py @@ -158,8 +158,10 @@ class TestSbApi(BaseOvnIdlTest): chassis, switch, port, binding = self._add_switch_port( self.data['chassis'][0]['name']) self.api.lsp_bind(port.name, chassis.name).execute(check_error=True) + network_id = binding.datapath.external_ids['name'].replace( + 'neutron-', '') self.assertEqual( - (chassis.name, str(binding.datapath.uuid)), + (chassis.name, network_id), self.api.get_logical_port_chassis_and_datapath(port.name))