mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 12:03:46 +00:00 
			
		
		
		
	zulip-puppet-apply: Exit status code 2 on puppet failure.
This allows us, when run with `--noop -f`, to differentiate between "there are unapplied changes" and "there were puppet errors."
This commit is contained in:
		
				
					committed by
					
						 Tim Abbott
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							9299fe65d2
						
					
				
				
					commit
					e4a766965d
				
			| @@ -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) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user