Merge "Remove all_routers argument from _process_routers"

This commit is contained in:
Jenkins 2014-10-09 18:46:10 +00:00 committed by Gerrit Code Review
commit 2faa9ab129
3 changed files with 6 additions and 9 deletions

View File

@ -1781,7 +1781,7 @@ class L3NATAgent(firewall_l3_agent.FWaaSL3AgentRpcCallback,
LOG.debug(_('Got router added to agent :%r'), payload) LOG.debug(_('Got router added to agent :%r'), payload)
self.routers_updated(context, payload) self.routers_updated(context, payload)
def _process_routers(self, routers, all_routers=False): def _process_routers(self, routers):
pool = eventlet.GreenPool() pool = eventlet.GreenPool()
if (self.conf.external_network_bridge and if (self.conf.external_network_bridge and
not ip_lib.device_exists(self.conf.external_network_bridge)): not ip_lib.device_exists(self.conf.external_network_bridge)):
@ -1795,9 +1795,6 @@ class L3NATAgent(firewall_l3_agent.FWaaSL3AgentRpcCallback,
# routers which should be removed. # routers which should be removed.
# If routers are from server side notification, we seek them # If routers are from server side notification, we seek them
# from subset of incoming routers and ones we have now. # 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( prev_router_ids = set(self.router_info) & set(
[router['id'] for router in routers]) [router['id'] for router in routers])
cur_router_ids = set() cur_router_ids = set()

View File

@ -130,13 +130,13 @@ class VPNAgent(l3_agent.L3NATAgentWithStateReport):
for device in self.devices: for device in self.devices:
device.destroy_router(router_id) device.destroy_router(router_id)
def _process_routers(self, routers, all_routers=False): def _process_routers(self, routers):
"""Router sync event. """Router sync event.
This method overwrites parent class method. This method overwrites parent class method.
:param routers: list of routers :param routers: list of routers
""" """
super(VPNAgent, self)._process_routers(routers, all_routers) super(VPNAgent, self)._process_routers(routers)
for device in self.devices: for device in self.devices:
device.sync(self.context, routers) device.sync(self.context, routers)

View File

@ -193,5 +193,5 @@ class TestVPNAgent(base.BaseTestCase):
device = mock.Mock() device = mock.Mock()
self.agent.devices = [device] self.agent.devices = [device]
self.agent._process_routers(routers, False) self.agent._process_routers(routers)
device.sync.assert_called_once_with(mock.ANY, routers) device.sync.assert_called_once_with(mock.ANY, routers)