Remove deprecated send_arp_for_ha option

Now Neutron always sends three gARPs after address assigned to an
interface.

Change-Id: I0d44f4cc59e1675b20d0da329faf7fd3ab91acbf
Closes-Bug: #1639879
This commit is contained in:
Ihar Hrachyshka 2017-04-18 07:54:45 -07:00 committed by Brian Haley
parent 2e7301f7a9
commit 8bb94820bd
10 changed files with 18 additions and 29 deletions

View File

@ -337,8 +337,7 @@ class FipNamespace(namespaces.Namespace):
for fixed_ip in agent_gateway_port['fixed_ips']:
ip_lib.send_ip_addr_adv_notif(ns_name,
interface_name,
fixed_ip['ip_address'],
self.agent_conf.send_arp_for_ha)
fixed_ip['ip_address'])
for subnet in agent_gateway_port['subnets']:
gw_ip = subnet.get('gateway_ip')

View File

@ -102,8 +102,7 @@ class DvrLocalRouter(dvr_router_base.DvrRouterBase):
self.fip_ns.agent_gateway_port['id']))
ip_lib.send_ip_addr_adv_notif(fip_ns_name,
interface_name,
floating_ip,
self.agent_conf.send_arp_for_ha)
floating_ip)
def _add_floating_ip_rule(self, floating_ip, fixed_ip):
rule_pr = self.fip_ns.allocate_rule_priority(floating_ip)

View File

@ -27,6 +27,5 @@ class LegacyRouter(router.RouterInfo):
# won't raise an exception to be handled.
ip_lib.send_ip_addr_adv_notif(self.ns_name,
interface_name,
fip['floating_ip_address'],
self.agent_conf.send_arp_for_ha)
fip['floating_ip_address'])
return lib_constants.FLOATINGIP_STATUS_ACTIVE

View File

@ -438,8 +438,7 @@ class RouterInfo(object):
for fixed_ip in fixed_ips:
ip_lib.send_ip_addr_adv_notif(ns_name,
interface_name,
fixed_ip['ip_address'],
self.agent_conf.send_arp_for_ha)
fixed_ip['ip_address'])
def internal_network_added(self, port):
network_id = port['network_id']
@ -704,8 +703,7 @@ class RouterInfo(object):
for fixed_ip in ex_gw_port['fixed_ips']:
ip_lib.send_ip_addr_adv_notif(ns_name,
interface_name,
fixed_ip['ip_address'],
self.agent_conf.send_arp_for_ha)
fixed_ip['ip_address'])
def is_v6_gateway_set(self, gateway_ips):
"""Check to see if list of gateway_ips has an IPv6 gateway.

View File

@ -41,11 +41,6 @@ OPTS = [
cfg.PortOpt('metadata_port',
default=9697,
help=_("TCP Port used by Neutron metadata namespace proxy.")),
cfg.IntOpt('send_arp_for_ha',
deprecated_for_removal=True,
default=3,
help=_("Send this many gratuitous ARPs for HA setup, if "
"less than or equal to 0, the feature is disabled")),
cfg.BoolOpt('handle_internal_only_routers',
default=True,
help=_("Indicates that this L3 agent should also handle "

View File

@ -82,7 +82,6 @@ class BasicRouterOperationsFramework(base.BaseTestCase):
self.conf.register_opts(ra.OPTS)
self.conf.set_override('interface_driver',
'neutron.agent.linux.interface.NullDriver')
self.conf.set_override('send_arp_for_ha', 1)
self.conf.set_override('state_path', cfg.CONF.state_path)
self.conf.set_override('pd_dhcp_driver', '')
@ -419,7 +418,7 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
self.assertEqual(1, self.mock_driver.init_router_port.call_count)
self.send_adv_notif.assert_called_once_with(ri.ns_name,
interface_name,
'99.0.1.9', mock.ANY)
'99.0.1.9')
elif action == 'remove':
self.device_exists.return_value = True
ri.internal_network_removed(port)
@ -542,11 +541,10 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
'clean_connections': True}
else:
exp_arp_calls = [mock.call(ri.ns_name, interface_name,
'20.0.0.30', mock.ANY)]
'20.0.0.30')]
if dual_stack and not no_sub_gw:
exp_arp_calls += [mock.call(ri.ns_name, interface_name,
'2001:192:168:100::2',
mock.ANY)]
'2001:192:168:100::2')]
self.send_adv_notif.assert_has_calls(exp_arp_calls)
ip_cidrs = ['20.0.0.30/24']
if dual_stack:
@ -686,11 +684,11 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
self.assertEqual(1, self.mock_driver.plug.call_count)
self.assertEqual(1, self.mock_driver.init_router_port.call_count)
exp_arp_calls = [mock.call(ri.ns_name, interface_name,
'20.0.0.30', mock.ANY)]
'20.0.0.30')]
if dual_stack:
ri.use_ipv6 = True
exp_arp_calls += [mock.call(ri.ns_name, interface_name,
'2001:192:168:100::2', mock.ANY)]
'2001:192:168:100::2')]
self.send_adv_notif.assert_has_calls(exp_arp_calls)
ip_cidrs = ['20.0.0.30/24']
gateway_ips = ['20.0.0.1']

View File

@ -120,12 +120,10 @@ class TestDvrFipNs(base.BaseTestCase):
expected = [
mock.call(self.fip_ns.get_name(),
interface_name,
agent_gw_port['fixed_ips'][0]['ip_address'],
mock.ANY),
agent_gw_port['fixed_ips'][0]['ip_address']),
mock.call(self.fip_ns.get_name(),
interface_name,
agent_gw_port['fixed_ips'][1]['ip_address'],
mock.ANY)]
agent_gw_port['fixed_ips'][1]['ip_address'])]
send_adv_notif.assert_has_calls(expected)
self.assertTrue(def_gw.called)

View File

@ -58,7 +58,6 @@ class TestDvrRouterOperations(base.BaseTestCase):
self.conf.register_opts(external_process.OPTS)
self.conf.set_override('interface_driver',
'neutron.agent.linux.interface.NullDriver')
self.conf.set_override('send_arp_for_ha', 1)
self.conf.set_override('state_path', cfg.CONF.state_path)
self.device_exists_p = mock.patch(

View File

@ -100,8 +100,7 @@ class TestAddFloatingIpWithMockGarp(BasicRouterTestCaseFramework):
ip_lib.send_ip_addr_adv_notif.assert_called_once_with(
ri.ns_name,
mock.sentinel.interface_name,
ip,
self.agent_conf.send_arp_for_ha)
ip)
self.assertEqual(lib_constants.FLOATINGIP_STATUS_ACTIVE, result)
def test_add_floating_ip_error(self, send_ip_addr_adv_notif):

View File

@ -0,0 +1,5 @@
---
upgrade:
- |
The ``send_arp_for_ha`` configuration option is removed. Neutron now always
sends three gratuitous ARP requests on address assigned to a port.