Browse Source

Merge "[OVN] Allow only one physical network per bridge" into stable/victoria

changes/74/824874/1
Zuul 4 months ago committed by Gerrit Code Review
parent
commit
7632e49ed3
  1. 3
      neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/impl_idl_ovn.py
  2. 3
      neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovsdb_monitor.py
  3. 11
      neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_impl_idl.py
  4. 4
      releasenotes/notes/ovn-limit-one-physnet-per-bridge-188285955a5ea124.yaml

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

@ -817,8 +817,7 @@ class OvsdbSbOvnIdl(sb_impl_idl.OvnSbApiIdlImpl, Backend):
def _get_chassis_physnets(self, chassis):
bridge_mappings = chassis.external_ids.get('ovn-bridge-mappings', '')
mapping_dict = helpers.parse_mappings(bridge_mappings.split(','),
unique_values=False)
mapping_dict = helpers.parse_mappings(bridge_mappings.split(','))
return list(mapping_dict.keys())
def chassis_exists(self, hostname):

3
neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovsdb_monitor.py

@ -137,8 +137,7 @@ class ChassisEvent(row_event.RowEvent):
phy_nets = []
if event != self.ROW_DELETE:
bridge_mappings = row.external_ids.get('ovn-bridge-mappings', '')
mapping_dict = helpers.parse_mappings(bridge_mappings.split(','),
unique_values=False)
mapping_dict = helpers.parse_mappings(bridge_mappings.split(','))
phy_nets = list(mapping_dict)
self.driver.update_segment_host_mapping(host, phy_nets)

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

@ -53,7 +53,7 @@ class TestSbApi(BaseOvnIdlTest):
{'external_ids': {'ovn-bridge-mappings':
'public:br-ex,private:br-0'}},
{'external_ids': {'ovn-bridge-mappings':
'public:br-ex,public2:br-ex'}},
'public:br-ex,public2:br-ex2'}},
{'external_ids': {'ovn-bridge-mappings':
'public:br-ex'}},
]
@ -99,6 +99,15 @@ class TestSbApi(BaseOvnIdlTest):
self.assertGreaterEqual(set(mapping.keys()),
{c['name'] for c in self.data['chassis']})
def test_multiple_physnets_in_one_bridge(self):
self.data = {
'chassis': [
{'external_ids': {'ovn-bridge-mappings': 'p1:br-ex,p2:br-ex'}}
]
}
self.load_test_data()
self.assertRaises(ValueError, self.api.get_chassis_and_physnets)
def _add_switch_port(self, chassis_name, type='localport'):
sname, pname = (utils.get_rand_device_name(prefix=p)
for p in ('switch', 'port'))

4
releasenotes/notes/ovn-limit-one-physnet-per-bridge-188285955a5ea124.yaml

@ -0,0 +1,4 @@
---
other:
- |
OVN mechanism driver allows only to have one physical network per bridge.
Loading…
Cancel
Save