zulip-puppet-apply: Make --force --noop have an exit code.

(cherry picked from commit ecfc23bd0b)
This commit is contained in:
Alex Vandiver
2022-03-25 16:16:01 -07:00
parent 236508f61e
commit 14e60fd203

View File

@@ -101,6 +101,12 @@ if not args.noop and not args.force:
if do_apply == "" or do_apply == "n":
sys.exit(0)
if args.noop and args.force:
if noop_would_change(puppet_cmd):
sys.exit(1)
else:
sys.exit(0)
ret = subprocess.call([*puppet_cmd, "--detailed-exitcodes"], env=puppet_env)
# ret = 0 => no changes, no errors
# ret = 2 => changes, no errors