Skip to content

Commit 502c6d1

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Prepare to handle ha_chassis_group for LRP"
2 parents 406665b + 9cec2e6 commit 502c6d1

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

ovn_octavia_provider/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,7 @@ def _get_lb_to_lr_association_commands(
11751175
def _find_ls_for_lr(self, router, ip_version):
11761176
ls = []
11771177
for port in router.ports:
1178-
if port.gateway_chassis:
1178+
if port.gateway_chassis or port.ha_chassis_group:
11791179
continue
11801180
if netaddr.IPNetwork(port.networks[0]).version != ip_version:
11811181
continue

ovn_octavia_provider/ovsdb/impl_idl_ovn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class OvnNbIdlForLb(ovsdb_monitor.OvnIdl):
209209
SCHEMA = "OVN_Northbound"
210210
TABLES = ('Logical_Switch', 'Load_Balancer', 'Load_Balancer_Health_Check',
211211
'Logical_Router', 'Logical_Switch_Port', 'Logical_Router_Port',
212-
'Gateway_Chassis', 'NAT')
212+
'Gateway_Chassis', 'NAT', 'HA_Chassis_Group')
213213

214214
def __init__(self, event_lock_name=None, notifier=True):
215215
self.conn_string = config.get_ovn_nb_connection()

ovn_octavia_provider/tests/unit/test_helper.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3036,11 +3036,13 @@ def test__find_lb_in_ls_wrong_ref(self):
30363036
def test__find_ls_for_lr(self):
30373037
p1 = fakes.FakeOVNPort.create_one_port(attrs={
30383038
'gateway_chassis': [],
3039+
'ha_chassis_group': [],
30393040
'external_ids': {
30403041
ovn_const.OVN_NETWORK_NAME_EXT_ID_KEY: 'foo1'},
30413042
'networks': ["10.0.0.1/24"]})
30423043
p2 = fakes.FakeOVNPort.create_one_port(attrs={
30433044
'gateway_chassis': [],
3045+
'ha_chassis_group': [],
30443046
'external_ids': {
30453047
ovn_const.OVN_NETWORK_NAME_EXT_ID_KEY: 'foo2'},
30463048
'networks': ["10.0.10.1/24"]})
@@ -3052,11 +3054,13 @@ def test__find_ls_for_lr(self):
30523054
def test__find_ls_for_lr_net_not_found(self):
30533055
p1 = fakes.FakeOVNPort.create_one_port(attrs={
30543056
'gateway_chassis': [],
3057+
'ha_chassis_group': [],
30553058
'external_ids': {
30563059
ovn_const.OVN_NETWORK_NAME_EXT_ID_KEY: 'foo1'},
30573060
'networks': ["10.0.0.1/24"]})
30583061
p2 = fakes.FakeOVNPort.create_one_port(attrs={
30593062
'gateway_chassis': [],
3063+
'ha_chassis_group': [],
30603064
'external_ids': {},
30613065
'networks': ["10.0.10.1/24"]})
30623066
self.router.ports.append(p2)
@@ -3067,11 +3071,13 @@ def test__find_ls_for_lr_net_not_found(self):
30673071
def test__find_ls_for_lr_different_ip_version(self):
30683072
p1 = fakes.FakeOVNPort.create_one_port(attrs={
30693073
'gateway_chassis': [],
3074+
'ha_chassis_group': [],
30703075
'external_ids': {
30713076
ovn_const.OVN_NETWORK_NAME_EXT_ID_KEY: 'foo1'},
30723077
'networks': ["10.0.0.1/24"]})
30733078
p2 = fakes.FakeOVNPort.create_one_port(attrs={
30743079
'gateway_chassis': [],
3080+
'ha_chassis_group': [],
30753081
'external_ids': {
30763082
ovn_const.OVN_NETWORK_NAME_EXT_ID_KEY: 'foo2'},
30773083
'networks': ["fdaa:4ad8:e8fb::/64"]})
@@ -3085,6 +3091,18 @@ def test__find_ls_for_lr_different_ip_version(self):
30853091
def test__find_ls_for_lr_gw_port(self):
30863092
p1 = fakes.FakeOVNPort.create_one_port(attrs={
30873093
'gateway_chassis': ['foo-gw-chassis'],
3094+
'ha_chassis_group': [],
3095+
'external_ids': {
3096+
ovn_const.OVN_NETWORK_NAME_EXT_ID_KEY: 'foo1'},
3097+
'networks': ["10.0.0.1/24"]})
3098+
self.router.ports.append(p1)
3099+
result = self.helper._find_ls_for_lr(self.router, n_const.IP_VERSION_4)
3100+
self.assertListEqual([], result)
3101+
3102+
def test__find_ls_for_lr_gw_port_ha_chassis_group(self):
3103+
p1 = fakes.FakeOVNPort.create_one_port(attrs={
3104+
'gateway_chassis': [],
3105+
'ha_chassis_group': 'foo-chassis-group',
30883106
'external_ids': {
30893107
ovn_const.OVN_NETWORK_NAME_EXT_ID_KEY: 'foo1'},
30903108
'networks': ["10.0.0.1/24"]})

0 commit comments

Comments
 (0)