Skip to content

Commit eb12b55

Browse files
authored
Merge pull request #146 from stackhpc/upstream/2023.1-2024-06-03
Synchronise 2023.1 with upstream
2 parents 63406e6 + ce2560f commit eb12b55

File tree

8 files changed

+25
-11
lines changed

8 files changed

+25
-11
lines changed

neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1983,7 +1983,8 @@ def set_gateway_mtu(self, context, prov_net, txn=None):
19831983
for port in ports:
19841984
lrp_name = utils.ovn_lrouter_port_name(port['id'])
19851985
options = self._gen_router_port_options(port, prov_net)
1986-
commands.append(self._nb_idl.lrp_set_options(lrp_name, **options))
1986+
commands.append(self._nb_idl.update_lrouter_port(
1987+
lrp_name, if_exists=True, **options))
19871988
self._transaction(commands, txn=txn)
19881989

19891990
def _check_network_changes_in_ha_chassis_groups(self, context, lswitch,

neutron/services/auto_allocate/db.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ def _check_requirements(self, context, tenant_id):
194194
except n_exc.NotFound:
195195
raise exceptions.AutoAllocationFailure(
196196
reason=_("No default subnetpools defined"))
197-
return {'id': 'dry-run=pass', 'tenant_id': tenant_id}
197+
return {'id': 'dry-run=pass',
198+
'tenant_id': tenant_id,
199+
'project_id': tenant_id}
198200

199201
def _validate(self, context, tenant_id):
200202
"""Validate and return the tenant to be associated to the topology."""

neutron/tests/functional/base.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
from oslo_log import log
3232
from oslo_utils import timeutils
3333
from oslo_utils import uuidutils
34+
from ovsdbapp.backend.ovs_idl import idlutils
3435

3536
from neutron.agent.linux import utils
3637
from neutron.api import extensions as exts
@@ -473,6 +474,13 @@ def append_cms_options(ext_ids, value):
473474
def del_fake_chassis(self, chassis, if_exists=True):
474475
self.sb_api.chassis_del(
475476
chassis, if_exists=if_exists).execute(check_error=True)
476-
if self.sb_api.is_table_present('Chassis_Private'):
477-
self.sb_api.db_destroy(
478-
'Chassis_Private', chassis).execute(check_error=True)
477+
try:
478+
if self.sb_api.is_table_present('Chassis_Private'):
479+
self.sb_api.db_destroy(
480+
'Chassis_Private', chassis).execute(check_error=True)
481+
except idlutils.RowNotFound:
482+
# NOTE(ykarel ): ovsdbapp >= 2.2.2 handles Chassis_Private
483+
# record delete with chassis
484+
# try/except can be dropped when neutron requirements.txt
485+
# include ovsdbapp>=2.2.2
486+
pass

neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/test_mech_driver.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,8 @@ def test_agent_list(self):
12151215
# then Chassis_Private.chassis = []; both metadata and controller
12161216
# agents will still be present in the agent list.
12171217
agent_event = AgentWaitEvent(self.mech_driver, [self.chassis],
1218-
events=(event.RowEvent.ROW_UPDATE,))
1218+
events=(event.RowEvent.ROW_UPDATE,
1219+
event.RowEvent.ROW_DELETE,))
12191220
self.sb_api.idl.notify_handler.watch_event(agent_event)
12201221
self.sb_api.chassis_del(self.chassis).execute(check_error=True)
12211222
self.assertTrue(agent_event.wait())

neutron/tests/unit/fake_resources.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def __init__(self, **kwargs):
6262
self.get_acls_for_lswitches = mock.Mock()
6363
self.create_lrouter = mock.Mock()
6464
self.lrp_del = mock.Mock()
65-
self.lrp_set_options = mock.Mock()
6665
self.update_lrouter = mock.Mock()
6766
self.delete_lrouter = mock.Mock()
6867
self.add_lrouter_port = mock.Mock()

neutron/tests/unit/plugins/ml2/drivers/ovn/mech_driver/test_mech_driver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2484,8 +2484,8 @@ def _test_update_network_fragmentation(self, new_mtu, expected_opts, grps):
24842484
self.mech_driver.update_network_postcommit(fake_ctx)
24852485

24862486
lrp_name = ovn_utils.ovn_lrouter_port_name(port['port']['id'])
2487-
self.nb_ovn.lrp_set_options.assert_called_once_with(
2488-
lrp_name, **expected_opts)
2487+
self.nb_ovn.update_lrouter_port.assert_called_once_with(
2488+
lrp_name, if_exists=True, **expected_opts)
24892489

24902490
def test_update_network_need_to_frag_enabled(self):
24912491
ovn_conf.cfg.CONF.set_override('ovn_emit_need_to_frag', True,

neutron/tests/unit/services/auto_allocate/test_db.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,10 @@ def test__check_requirements_happy_path_for_kevin(self):
351351
mock.patch.object(
352352
self.mixin, '_get_supported_subnetpools'):
353353
result = self.mixin._check_requirements(self.ctx, 'foo_tenant')
354-
expected = {'id': 'dry-run=pass', 'tenant_id': 'foo_tenant'}
354+
expected = {
355+
'id': 'dry-run=pass',
356+
'tenant_id': 'foo_tenant',
357+
'project_id': 'foo_tenant'}
355358
self.assertEqual(expected, result)
356359

357360
def test__cleanup_handles_failures(self):

neutron/tests/unit/services/ovn_l3/test_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1689,7 +1689,7 @@ def test_add_router_interface_need_to_frag_enabled_then_remove(
16891689
self.l3_inst._nb_ovn.add_lrouter_port.assert_called_once_with(
16901690
**fake_router_port_assert)
16911691
# Since if_exists = True it will safely return
1692-
self.l3_inst._nb_ovn.lrp_set_options(
1692+
self.l3_inst._nb_ovn.update_lrouter_port(
16931693
name='lrp-router-port-id', if_exists=True,
16941694
options=fake_router_port_assert)
16951695
# If no if_exists is provided, it is defaulted to true, so this

0 commit comments

Comments
 (0)