mirror of
https://github.com/rocky-linux/createhdds.git
synced 2024-11-15 17:51:25 +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:
parent
8c0493ac35
commit
359da3d896
@ -524,8 +524,8 @@ def cli_check(args, hdds):
|
|||||||
"""Function for the CLI 'check' subcommand. Basically just calls
|
"""Function for the CLI 'check' subcommand. Basically just calls
|
||||||
check() and prints the results. Does renames before checking if
|
check() and prints the results. Does renames before checking if
|
||||||
args.rename was set, and wipes 'unknown' images after 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
|
args.clean was set. Exits with status 2 if any images are missing,
|
||||||
outdated files are found (handy for scripting/automation).
|
1 if all images are present but one or more is outdated.
|
||||||
"""
|
"""
|
||||||
if args.rename:
|
if args.rename:
|
||||||
do_renames(hdds)
|
do_renames(hdds)
|
||||||
@ -540,8 +540,10 @@ def cli_check(args, hdds):
|
|||||||
if args.clean:
|
if args.clean:
|
||||||
clean(unknown)
|
clean(unknown)
|
||||||
|
|
||||||
if missing or outdated:
|
if missing:
|
||||||
sys.exit("Missing and/or outdated images found!")
|
sys.exit(2)
|
||||||
|
elif outdated:
|
||||||
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user