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:
Ralf Haferkamp 2014-03-17 16:12:09 +01:00
parent 2ff4fa9168
commit ae6cdb70d2
1 changed files with 4 additions and 0 deletions

View File

@ -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