Browse Source

Merge "[stable only][ovn]Update get datapath id to network from Port_Binding" into stable/ussuri

changes/72/825472/1
Zuul 4 months ago committed by Gerrit Code Review
parent
commit
15e9574294
  1. 5
      neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/impl_idl_ovn.py
  2. 4
      neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_impl_idl.py

5
neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/impl_idl_ovn.py

@ -911,6 +911,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

4
neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_impl_idl.py

@ -145,8 +145,10 @@ class TestSbApi(base.FunctionalTestCase,
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))

Loading…
Cancel
Save