diff --git a/scripts/zulip-puppet-apply b/scripts/zulip-puppet-apply index a1ffc356d5..b6238ef856 100755 --- a/scripts/zulip-puppet-apply +++ b/scripts/zulip-puppet-apply @@ -83,6 +83,8 @@ def noop_would_change(puppet_cmd: List[str]) -> bool: with open(lastrun_file.name) as lastrun: lastrun_data = yaml.safe_load(lastrun) return lastrun_data.get("resources", {}).get("out_of_sync", 0) != 0 + except subprocess.CalledProcessError: + sys.exit(2) finally: lastrun_file.close() @@ -111,4 +113,4 @@ ret = subprocess.call([*puppet_cmd, "--detailed-exitcodes"], env=puppet_env) # ret = 4 => no changes, yes errors # ret = 6 => changes, yes errors if ret != 0 and ret != 2: - sys.exit(1) + sys.exit(2)