From 8923c6fae229c8e3dd85972811989698e482d7f6 Mon Sep 17 00:00:00 2001 From: Carl Baldwin Date: Thu, 2 Oct 2014 17:02:59 +0000 Subject: [PATCH] Remove all_routers argument from _process_routers There is no code left that passes True to this argument. It is dead code and it should be removed. Change-Id: I55f71a5c0b96e530e45f2a6463978e8611cbc537 --- neutron/agent/l3_agent.py | 9 +++------ neutron/services/vpn/agent.py | 4 ++-- neutron/tests/unit/services/vpn/test_vpn_agent.py | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/neutron/agent/l3_agent.py b/neutron/agent/l3_agent.py index 9f117635b..4e052a373 100644 --- a/neutron/agent/l3_agent.py +++ b/neutron/agent/l3_agent.py @@ -1781,7 +1781,7 @@ class L3NATAgent(firewall_l3_agent.FWaaSL3AgentRpcCallback, LOG.debug(_('Got router added to agent :%r'), payload) self.routers_updated(context, payload) - def _process_routers(self, routers, all_routers=False): + def _process_routers(self, routers): pool = eventlet.GreenPool() if (self.conf.external_network_bridge and not ip_lib.device_exists(self.conf.external_network_bridge)): @@ -1795,11 +1795,8 @@ class L3NATAgent(firewall_l3_agent.FWaaSL3AgentRpcCallback, # routers which should be removed. # If routers are from server side notification, we seek them # from subset of incoming routers and ones we have now. - if all_routers: - prev_router_ids = set(self.router_info) - else: - prev_router_ids = set(self.router_info) & set( - [router['id'] for router in routers]) + prev_router_ids = set(self.router_info) & set( + [router['id'] for router in routers]) cur_router_ids = set() for r in routers: # If namespaces are disabled, only process the router associated diff --git a/neutron/services/vpn/agent.py b/neutron/services/vpn/agent.py index 284e02aac..12e969df9 100644 --- a/neutron/services/vpn/agent.py +++ b/neutron/services/vpn/agent.py @@ -130,13 +130,13 @@ class VPNAgent(l3_agent.L3NATAgentWithStateReport): for device in self.devices: device.destroy_router(router_id) - def _process_routers(self, routers, all_routers=False): + def _process_routers(self, routers): """Router sync event. This method overwrites parent class method. :param routers: list of routers """ - super(VPNAgent, self)._process_routers(routers, all_routers) + super(VPNAgent, self)._process_routers(routers) for device in self.devices: device.sync(self.context, routers) diff --git a/neutron/tests/unit/services/vpn/test_vpn_agent.py b/neutron/tests/unit/services/vpn/test_vpn_agent.py index f360dfaa1..4cde577d2 100644 --- a/neutron/tests/unit/services/vpn/test_vpn_agent.py +++ b/neutron/tests/unit/services/vpn/test_vpn_agent.py @@ -193,5 +193,5 @@ class TestVPNAgent(base.BaseTestCase): device = mock.Mock() self.agent.devices = [device] - self.agent._process_routers(routers, False) + self.agent._process_routers(routers) device.sync.assert_called_once_with(mock.ANY, routers) -- 2.45.2