Merge "Remove check_router_mac_binding_options maintenance task"
This commit is contained in:
commit
bfe05ec58f
@ -14,7 +14,6 @@
|
||||
# under the License.
|
||||
|
||||
import abc
|
||||
import copy
|
||||
import functools
|
||||
import inspect
|
||||
import threading
|
||||
@ -626,28 +625,6 @@ class DBInconsistenciesPeriodics(SchemaAwarePeriodicsBase):
|
||||
{ovn_const.LSP_OPTIONS_LOCALNET_LEARN_FDB: 'false'})))
|
||||
raise periodics.NeverAgain()
|
||||
|
||||
# TODO(lucasagomes): Remove this in the Z cycle
|
||||
# A static spacing value is used here, but this method will only run
|
||||
# once per lock due to the use of periodics.NeverAgain().
|
||||
@has_lock_periodic(spacing=600, run_immediately=True)
|
||||
def check_router_mac_binding_options(self):
|
||||
cmds = []
|
||||
for router in self._nb_idl.lr_list().execute(check_error=True):
|
||||
if (router.options.get('always_learn_from_arp_request') and
|
||||
router.options.get('dynamic_neigh_routers')):
|
||||
continue
|
||||
|
||||
opts = copy.deepcopy(router.options)
|
||||
opts.update({'always_learn_from_arp_request': 'false',
|
||||
'dynamic_neigh_routers': 'true'})
|
||||
cmds.append(self._nb_idl.update_lrouter(router.name, options=opts))
|
||||
|
||||
if cmds:
|
||||
with self._nb_idl.transaction(check_error=True) as txn:
|
||||
for cmd in cmds:
|
||||
txn.add(cmd)
|
||||
raise periodics.NeverAgain()
|
||||
|
||||
# A static spacing value is used here, but this method will only run
|
||||
# once per lock due to the use of periodics.NeverAgain().
|
||||
@has_lock_periodic(spacing=600, run_immediately=True)
|
||||
|
@ -693,34 +693,6 @@ class TestDBInconsistenciesPeriodics(testlib_api.SqlTestCaseLight,
|
||||
('options', options))]
|
||||
nb_idl.db_set.assert_has_calls(expected_calls)
|
||||
|
||||
def test_check_router_mac_binding_options(self):
|
||||
nb_idl = self.fake_ovn_client._nb_idl
|
||||
lr0 = fakes.FakeOvsdbRow.create_one_ovsdb_row(
|
||||
attrs={'name': 'lr0',
|
||||
'options': {'always_learn_from_arp_request': 'false',
|
||||
'dynamic_neigh_routers': 'true'}})
|
||||
lr1 = fakes.FakeOvsdbRow.create_one_ovsdb_row(
|
||||
attrs={'name': 'lr1', 'options': {}})
|
||||
lr2 = fakes.FakeOvsdbRow.create_one_ovsdb_row(
|
||||
attrs={'name': 'lr2', 'options': {}})
|
||||
nb_idl.lr_list.return_value.execute.return_value = [lr0, lr1, lr2]
|
||||
|
||||
# Invoke the periodic method, it meant to run only once at startup
|
||||
# so NeverAgain will be raised at the end
|
||||
self.assertRaises(periodics.NeverAgain,
|
||||
self.periodic.check_router_mac_binding_options)
|
||||
|
||||
# Assert lr1 and lr2 had their options updated since the values
|
||||
# were not set
|
||||
expected_calls = [
|
||||
mock.call('lr1',
|
||||
options={'always_learn_from_arp_request': 'false',
|
||||
'dynamic_neigh_routers': 'true'}),
|
||||
mock.call('lr2',
|
||||
options={'always_learn_from_arp_request': 'false',
|
||||
'dynamic_neigh_routers': 'true'})]
|
||||
nb_idl.update_lrouter.assert_has_calls(expected_calls)
|
||||
|
||||
def _test_check_redirect_type_router_gateway_ports(self, networks,
|
||||
redirect_value):
|
||||
self.fake_ovn_client._plugin.get_ports.return_value = [{
|
||||
|
Loading…
Reference in New Issue
Block a user