diff --git a/neutron/agent/linux/keepalived.py b/neutron/agent/linux/keepalived.py index a42e42ad1f7..c2ffe06d02e 100644 --- a/neutron/agent/linux/keepalived.py +++ b/neutron/agent/linux/keepalived.py @@ -117,13 +117,8 @@ class KeepalivedVipAddress(object): result = '%s dev %s' % (self.ip_address, self.interface_name) if self.scope: result += ' scope %s' % self.scope - if cfg.CONF.keepalived_use_no_track and not self.track: - if _is_keepalived_use_no_track_supported(): - result += ' no_track' - else: - LOG.warning("keepalived_use_no_track cfg option is True but " - "keepalived on host seems to not support this " - "option") + if not self.track and _is_keepalived_use_no_track_supported(): + result += ' no_track' return result @@ -145,13 +140,8 @@ class KeepalivedVirtualRoute(object): output += ' dev %s' % self.interface_name if self.scope: output += ' scope %s' % self.scope - if cfg.CONF.keepalived_use_no_track: - if _is_keepalived_use_no_track_supported(): - output += ' no_track' - else: - LOG.warning("keepalived_use_no_track cfg option is True but " - "keepalived on host seems to not support this " - "option") + if _is_keepalived_use_no_track_supported(): + output += ' no_track' # NOTE(mstinsky): neutron and keepalived are adding the same routes on # primary routers. With this we ensure that both are adding the routes # with the same procotol and prevent duplicated routes which result in diff --git a/neutron/conf/agent/l3/config.py b/neutron/conf/agent/l3/config.py index 1983529e880..8e5c961685a 100644 --- a/neutron/conf/agent/l3/config.py +++ b/neutron/conf/agent/l3/config.py @@ -107,17 +107,6 @@ OPTS = [ 'the state change monitor. NOTE: Setting to True ' 'could affect the data plane when stopping or ' 'restarting the L3 agent.')), - cfg.BoolOpt('keepalived_use_no_track', - default=True, - deprecated_for_removal=True, - deprecated_reason='By keepalived version detection introduced ' - 'by https://review.opendev.org/757620 there ' - 'is no need for this config option. To be ' - 'removed in X.', - help=_('If keepalived without support for "no_track" option ' - 'is used, this should be set to False. ' - 'Support for this option was introduced in keepalived ' - '2.x')) ] diff --git a/neutron/tests/unit/agent/linux/test_keepalived.py b/neutron/tests/unit/agent/linux/test_keepalived.py index 169f075ff95..84b815d454d 100644 --- a/neutron/tests/unit/agent/linux/test_keepalived.py +++ b/neutron/tests/unit/agent/linux/test_keepalived.py @@ -220,61 +220,6 @@ class KeepalivedConfTestCase(KeepalivedBaseTestCase, self.assertEqual(['192.168.2.0/24', '192.168.3.0/24'], current_vips) -class KeepalivedConfWithoutNoTrackTestCase(KeepalivedConfTestCase): - - expected = KEEPALIVED_GLOBAL_CONFIG + textwrap.dedent(""" - vrrp_instance VR_1 { - state MASTER - interface eth0 - virtual_router_id 1 - priority 50 - garp_master_delay 60 - advert_int 5 - authentication { - auth_type AH - auth_pass pass123 - } - track_interface { - eth0 - } - virtual_ipaddress { - 169.254.0.1/24 dev eth0 - } - virtual_ipaddress_excluded { - 192.168.1.0/24 dev eth1 - 192.168.2.0/24 dev eth2 - 192.168.3.0/24 dev eth2 - 192.168.55.0/24 dev eth10 - } - virtual_routes { - 0.0.0.0/0 via 192.168.1.1 dev eth1 protocol static - } - } - vrrp_instance VR_2 { - state MASTER - interface eth4 - virtual_router_id 2 - priority 50 - garp_master_delay 60 - mcast_src_ip 224.0.0.1 - track_interface { - eth4 - } - virtual_ipaddress { - 169.254.0.2/24 dev eth4 - } - virtual_ipaddress_excluded { - 192.168.2.0/24 dev eth2 - 192.168.3.0/24 dev eth6 - 192.168.55.0/24 dev eth10 - } - }""") - - def setUp(self): - super(KeepalivedConfWithoutNoTrackTestCase, self).setUp() - cfg.CONF.set_override('keepalived_use_no_track', False) - - class KeepalivedStateExceptionTestCase(KeepalivedBaseTestCase): def test_state_exception(self): invalid_vrrp_state = 'a seal walks' @@ -353,12 +298,6 @@ class KeepalivedInstanceRoutesTestCase(KeepalivedBaseTestCase): self.assertEqual(self._get_no_track_less_expected_config(), '\n'.join(routes.build_config())) - def test_build_config_without_no_track_option(self): - cfg.CONF.set_override('keepalived_use_no_track', False) - routes = self._get_instance_routes() - self.assertEqual(self._get_no_track_less_expected_config(), - '\n'.join(routes.build_config())) - class KeepalivedInstanceTestCase(KeepalivedBaseTestCase, KeepalivedConfBaseMixin): @@ -432,10 +371,6 @@ class KeepalivedInstanceTestCase(KeepalivedBaseTestCase, return_value=False): self._test_remove_addresses_by_interface("") - def test_remove_addresses_by_interface_without_no_track(self): - cfg.CONF.set_override('keepalived_use_no_track', False) - self._test_remove_addresses_by_interface("") - def test_build_config_no_vips(self): expected = textwrap.dedent("""\ vrrp_instance VR_1 { @@ -514,13 +449,6 @@ class KeepalivedVirtualRouteTestCase(KeepalivedBaseTestCase): self.assertEqual('0.0.0.0/0 via 1.2.3.4 dev eth0 protocol static', route.build_config()) - def test_virtual_route_with_dev_without_no_track(self): - cfg.CONF.set_override('keepalived_use_no_track', False) - route = keepalived.KeepalivedVirtualRoute(n_consts.IPv4_ANY, '1.2.3.4', - 'eth0') - self.assertEqual('0.0.0.0/0 via 1.2.3.4 dev eth0 protocol static', - route.build_config()) - def test_virtual_route_without_dev(self): with mock.patch.object( keepalived, '_is_keepalived_use_no_track_supported', @@ -537,12 +465,6 @@ class KeepalivedVirtualRouteTestCase(KeepalivedBaseTestCase): self.assertEqual('50.0.0.0/8 via 1.2.3.4 protocol static', route.build_config()) - def test_virtual_route_without_dev_without_no_track(self): - cfg.CONF.set_override('keepalived_use_no_track', False) - route = keepalived.KeepalivedVirtualRoute('50.0.0.0/8', '1.2.3.4') - self.assertEqual('50.0.0.0/8 via 1.2.3.4 protocol static', - route.build_config()) - class KeepalivedTrackScriptTestCase(KeepalivedBaseTestCase): diff --git a/releasenotes/notes/remove-deprecated-keepalived_use_no_track-5a5201e75df0271e.yaml b/releasenotes/notes/remove-deprecated-keepalived_use_no_track-5a5201e75df0271e.yaml new file mode 100644 index 00000000000..09b20a93b1e --- /dev/null +++ b/releasenotes/notes/remove-deprecated-keepalived_use_no_track-5a5201e75df0271e.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - | + The deprecated config option ``keepalived_use_no_track`` is removed.