neutron-ha-tool: Use a non-zero exit code when a migration is needed
This can be helpful when using "neutron-ha-tool --l3-agent-check" outside of the network cookbook to check whether some routers are offline. Change-Id: I4b502a778bd32980680ccc3202a14d637199b81d
This commit is contained in:
parent
2ff4fa9168
commit
ae6cdb70d2
|
@ -190,8 +190,12 @@ def l3_agent_check(qclient, noop=False):
|
|||
LOG.warn("There are no l3 agents alive we could migrate routers onto")
|
||||
target_id = None
|
||||
|
||||
migration_count+=1
|
||||
LOG.info("Would like to migrate router=%s to agent=%s", router_id, target_id)
|
||||
|
||||
if migration_count > 0:
|
||||
sys.exit(2)
|
||||
|
||||
def l3_agent_migrate(qclient, noop=False, now=False):
|
||||
"""
|
||||
Walk the l3 agents searching for agents that are offline. For those that are
|
||||
|
|
Loading…
Reference in New Issue