Merge "Update _check_router_retain_needed()"
This commit is contained in:
@@ -177,19 +177,15 @@ class L3AgentSchedulerDbMixin(l3agentscheduler.L3AgentSchedulerPluginBase,
|
|||||||
"""Check whether a router needs to be retained on a host.
|
"""Check whether a router needs to be retained on a host.
|
||||||
|
|
||||||
Check whether there are DVR serviceable ports owned by the host of
|
Check whether there are DVR serviceable ports owned by the host of
|
||||||
a l3 agent. If so, then the routers should be retained.
|
an l3 agent. If so, then the routers should be retained.
|
||||||
"""
|
"""
|
||||||
if not host:
|
if not host or not router.get('distributed'):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
retain_router = False
|
|
||||||
if router.get('distributed'):
|
|
||||||
plugin = directory.get_plugin(plugin_constants.L3)
|
plugin = directory.get_plugin(plugin_constants.L3)
|
||||||
subnet_ids = plugin.get_subnet_ids_on_router(context, router['id'])
|
subnet_ids = plugin.get_subnet_ids_on_router(context, router['id'])
|
||||||
if subnet_ids:
|
return plugin._check_dvr_serviceable_ports_on_host(context, host,
|
||||||
retain_router = plugin._check_dvr_serviceable_ports_on_host(
|
subnet_ids)
|
||||||
context, host, subnet_ids)
|
|
||||||
return retain_router
|
|
||||||
|
|
||||||
def remove_router_from_l3_agent(self, context, agent_id, router_id):
|
def remove_router_from_l3_agent(self, context, agent_id, router_id):
|
||||||
"""Remove the router from l3 agent.
|
"""Remove the router from l3 agent.
|
||||||
|
|||||||
Reference in New Issue
Block a user