self.removed_routers = set()
self.sync_progress = False
- self._delete_stale_namespaces = (self.conf.use_namespaces and
- self.conf.router_delete_namespaces)
+ self._clean_stale_namespaces = self.conf.use_namespaces
self.rpc_loop = loopingcall.FixedIntervalLoopingCall(
self._rpc_loop)
def _cleanup_namespaces(self, routers):
"""Destroy stale router namespaces on host when L3 agent restarts
- This routine is called when self._delete_stale_namespaces is True.
+ This routine is called when self._clean_stale_namespaces is True.
The argument routers is the list of routers that are recorded in
the database as being hosted on this node.
except RuntimeError:
LOG.exception(_('Failed to destroy stale router namespace '
'%s'), ns)
- self._delete_stale_namespaces = False
+ self._clean_stale_namespaces = False
def _destroy_router_namespace(self, namespace):
ns_ip = ip_lib.IPWrapper(self.root_helper, namespace=namespace)
# Resync is not necessary for the cleanup of stale
# namespaces.
- if self._delete_stale_namespaces:
+ if self._clean_stale_namespaces:
self._cleanup_namespaces(routers)
def after_start(self):
self.conf.set_override('router_id', '1234')
agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
self.assertEqual(['1234'], agent._router_ids())
- self.assertFalse(agent._delete_stale_namespaces)
+ self.assertFalse(agent._clean_stale_namespaces)
def test_process_routers_with_no_ext_net_in_conf(self):
agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
- self.assertTrue(agent._delete_stale_namespaces)
+ self.assertTrue(agent._clean_stale_namespaces)
pm = self.external_process.return_value
pm.reset_mock()
expected_args = [mock.call(ns) for ns in stale_namespace_list]
agent._destroy_router_namespace.assert_has_calls(expected_args,
any_order=True)
- self.assertFalse(agent._delete_stale_namespaces)
+ self.assertFalse(agent._clean_stale_namespaces)
def test_cleanup_namespace(self):
self.conf.set_override('router_id', None)