Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1983,7 +1983,8 @@ def set_gateway_mtu(self, context, prov_net, txn=None):
for port in ports:
lrp_name = utils.ovn_lrouter_port_name(port['id'])
options = self._gen_router_port_options(port, prov_net)
commands.append(self._nb_idl.lrp_set_options(lrp_name, **options))
commands.append(self._nb_idl.update_lrouter_port(
lrp_name, if_exists=True, **options))
self._transaction(commands, txn=txn)

def _check_network_changes_in_ha_chassis_groups(self, context, lswitch,
Expand Down
4 changes: 3 additions & 1 deletion neutron/services/auto_allocate/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ def _check_requirements(self, context, tenant_id):
except n_exc.NotFound:
raise exceptions.AutoAllocationFailure(
reason=_("No default subnetpools defined"))
return {'id': 'dry-run=pass', 'tenant_id': tenant_id}
return {'id': 'dry-run=pass',
'tenant_id': tenant_id,
'project_id': tenant_id}

def _validate(self, context, tenant_id):
"""Validate and return the tenant to be associated to the topology."""
Expand Down
14 changes: 11 additions & 3 deletions neutron/tests/functional/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from oslo_log import log
from oslo_utils import timeutils
from oslo_utils import uuidutils
from ovsdbapp.backend.ovs_idl import idlutils

from neutron.agent.linux import utils
from neutron.api import extensions as exts
Expand Down Expand Up @@ -473,6 +474,13 @@ def append_cms_options(ext_ids, value):
def del_fake_chassis(self, chassis, if_exists=True):
self.sb_api.chassis_del(
chassis, if_exists=if_exists).execute(check_error=True)
if self.sb_api.is_table_present('Chassis_Private'):
self.sb_api.db_destroy(
'Chassis_Private', chassis).execute(check_error=True)
try:
if self.sb_api.is_table_present('Chassis_Private'):
self.sb_api.db_destroy(
'Chassis_Private', chassis).execute(check_error=True)
except idlutils.RowNotFound:
# NOTE(ykarel ): ovsdbapp >= 2.2.2 handles Chassis_Private
# record delete with chassis
# try/except can be dropped when neutron requirements.txt
# include ovsdbapp>=2.2.2
pass
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,8 @@ def test_agent_list(self):
# then Chassis_Private.chassis = []; both metadata and controller
# agents will still be present in the agent list.
agent_event = AgentWaitEvent(self.mech_driver, [self.chassis],
events=(event.RowEvent.ROW_UPDATE,))
events=(event.RowEvent.ROW_UPDATE,
event.RowEvent.ROW_DELETE,))
self.sb_api.idl.notify_handler.watch_event(agent_event)
self.sb_api.chassis_del(self.chassis).execute(check_error=True)
self.assertTrue(agent_event.wait())
Expand Down
1 change: 0 additions & 1 deletion neutron/tests/unit/fake_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def __init__(self, **kwargs):
self.get_acls_for_lswitches = mock.Mock()
self.create_lrouter = mock.Mock()
self.lrp_del = mock.Mock()
self.lrp_set_options = mock.Mock()
self.update_lrouter = mock.Mock()
self.delete_lrouter = mock.Mock()
self.add_lrouter_port = mock.Mock()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2484,8 +2484,8 @@ def _test_update_network_fragmentation(self, new_mtu, expected_opts, grps):
self.mech_driver.update_network_postcommit(fake_ctx)

lrp_name = ovn_utils.ovn_lrouter_port_name(port['port']['id'])
self.nb_ovn.lrp_set_options.assert_called_once_with(
lrp_name, **expected_opts)
self.nb_ovn.update_lrouter_port.assert_called_once_with(
lrp_name, if_exists=True, **expected_opts)

def test_update_network_need_to_frag_enabled(self):
ovn_conf.cfg.CONF.set_override('ovn_emit_need_to_frag', True,
Expand Down
5 changes: 4 additions & 1 deletion neutron/tests/unit/services/auto_allocate/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,10 @@ def test__check_requirements_happy_path_for_kevin(self):
mock.patch.object(
self.mixin, '_get_supported_subnetpools'):
result = self.mixin._check_requirements(self.ctx, 'foo_tenant')
expected = {'id': 'dry-run=pass', 'tenant_id': 'foo_tenant'}
expected = {
'id': 'dry-run=pass',
'tenant_id': 'foo_tenant',
'project_id': 'foo_tenant'}
self.assertEqual(expected, result)

def test__cleanup_handles_failures(self):
Expand Down
2 changes: 1 addition & 1 deletion neutron/tests/unit/services/ovn_l3/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ def test_add_router_interface_need_to_frag_enabled_then_remove(
self.l3_inst._nb_ovn.add_lrouter_port.assert_called_once_with(
**fake_router_port_assert)
# Since if_exists = True it will safely return
self.l3_inst._nb_ovn.lrp_set_options(
self.l3_inst._nb_ovn.update_lrouter_port(
name='lrp-router-port-id', if_exists=True,
options=fake_router_port_assert)
# If no if_exists is provided, it is defaulted to true, so this
Expand Down