From 084bb68986711e68421363bdf48f47ed1c744ba8 Mon Sep 17 00:00:00 2001 From: Carl Baldwin Date: Wed, 8 Oct 2014 03:22:49 +0000 Subject: [PATCH] Remove two sets that are not referenced The code no longer references the updated_routers and removed_routers sets. This should have been cleaned up before but was missed. Closes-bug: #1232525 Change-Id: I0396e13d2f7c3789928e0c6a4c0a071b02d5ff17 (cherry picked from commit edb26bfcddf9d9a0e95955a6590d11fa7245ea2b) --- neutron/agent/l3_agent.py | 10 ---------- neutron/tests/unit/test_l3_agent.py | 19 ------------------- 2 files changed, 29 deletions(-) diff --git a/neutron/agent/l3_agent.py b/neutron/agent/l3_agent.py index b3c63eefb..ff8ad47db 100644 --- a/neutron/agent/l3_agent.py +++ b/neutron/agent/l3_agent.py @@ -523,8 +523,6 @@ class L3NATAgent(firewall_l3_agent.FWaaSL3AgentRpcCallback, self.context = context.get_admin_context_without_session() self.plugin_rpc = L3PluginApi(topics.L3PLUGIN, host) self.fullsync = True - self.updated_routers = set() - self.removed_routers = set() self.sync_progress = False # Get the list of service plugins from Neutron Server @@ -1843,12 +1841,6 @@ class L3NATAgent(firewall_l3_agent.FWaaSL3AgentRpcCallback, while True: pool.spawn_n(self._process_router_update) - def _process_router_delete(self): - current_removed_routers = list(self.removed_routers) - for router_id in current_removed_routers: - self._router_removed(router_id) - self.removed_routers.remove(router_id) - def _router_ids(self): if not self.conf.use_namespaces: return [self.conf.router_id] @@ -1874,8 +1866,6 @@ class L3NATAgent(firewall_l3_agent.FWaaSL3AgentRpcCallback, try: router_ids = self._router_ids() - self.updated_routers.clear() - self.removed_routers.clear() timestamp = timeutils.utcnow() routers = self.plugin_rpc.get_routers( context, router_ids) diff --git a/neutron/tests/unit/test_l3_agent.py b/neutron/tests/unit/test_l3_agent.py index 3d2d33c52..8de7922d2 100644 --- a/neutron/tests/unit/test_l3_agent.py +++ b/neutron/tests/unit/test_l3_agent.py @@ -1765,25 +1765,6 @@ vrrp_instance VR_1 { agent.router_added_to_agent(None, [FAKE_ID]) agent._queue.add.assert_called_once() - def test_process_router_delete(self): - agent = l3_agent.L3NATAgent(HOSTNAME, self.conf) - ex_gw_port = {'id': _uuid(), - 'network_id': _uuid(), - 'fixed_ips': [{'ip_address': '19.4.4.4', - 'subnet_id': _uuid()}], - 'subnet': {'cidr': '19.4.4.0/24', - 'gateway_ip': '19.4.4.1'}} - router = { - 'id': _uuid(), - 'enable_snat': True, - 'routes': [], - 'gw_port': ex_gw_port} - router['distributed'] = False - agent._router_added(router['id'], router) - agent.router_deleted(None, router['id']) - agent._process_router_delete() - self.assertFalse(list(agent.removed_routers)) - def test_destroy_fip_namespace(self): class FakeDev(object): def __init__(self, name): -- 2.45.2