Commit 64be07b1 authored by Michael Hanselmann's avatar Michael Hanselmann

gnt-instance reinstall: Don't always exit with success

If one or more jobs failed the exit status should be set accordingly.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarBernardo Dal Seno <bdalseno@google.com>
parent 2ef3383e
......@@ -486,8 +486,12 @@ def ReinstallInstance(opts, args):
osparams=opts.osparams)
jex.QueueJob(instance_name, op)
jex.WaitOrShow(not opts.submit_only)
return 0
results = jex.WaitOrShow(not opts.submit_only)
if compat.all(map(compat.fst, results)):
return constants.EXIT_SUCCESS
else:
return constants.EXIT_FAILURE
def RemoveInstance(opts, args):
......
......@@ -140,6 +140,12 @@ def TestInstanceReinstall(instance):
"""gnt-instance reinstall"""
AssertCommand(["gnt-instance", "reinstall", "-f", instance["name"]])
# Test with non-existant OS definition
AssertCommand(["gnt-instance", "reinstall", "-f",
"--os-type=NonExistantOsForQa",
instance["name"]],
fail=True)
def _ReadSsconfInstanceList():
"""Reads ssconf_instance_list from the master node.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment