1
0
mirror of https://pagure.io/fedora-qa/createhdds.git synced 2024-11-25 00:03:08 +00:00

createhdds: exit 2 if images missing, 1 if outdated

This will help us fine-tune the behaviour of the ansible plays.
This commit is contained in:
Adam Williamson 2016-10-17 11:26:18 -07:00
parent 8c0493ac35
commit 359da3d896

View File

@ -524,8 +524,8 @@ def cli_check(args, hdds):
"""Function for the CLI 'check' subcommand. Basically just calls
check() and prints the results. Does renames before checking if
args.rename was set, and wipes 'unknown' images after checking if
args.clean was set. Exits with status 1 if any missing and/or
outdated files are found (handy for scripting/automation).
args.clean was set. Exits with status 2 if any images are missing,
1 if all images are present but one or more is outdated.
"""
if args.rename:
do_renames(hdds)
@ -540,8 +540,10 @@ def cli_check(args, hdds):
if args.clean:
clean(unknown)
if missing or outdated:
sys.exit("Missing and/or outdated images found!")
if missing:
sys.exit(2)
elif outdated:
sys.exit(1)
else:
sys.exit()