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)):
# 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
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)
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)