mirror of
				https://github.com/jtesta/ssh-audit.git
				synced 2025-10-31 09:31:01 +01:00 
			
		
		
		
	Now returns -1 when an uncaught exception is found.
This commit is contained in:
		
							
								
								
									
										10
									
								
								ssh-audit.py
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								ssh-audit.py
									
									
									
									
									
								
							| @@ -51,6 +51,7 @@ PROGRAM_RETVAL_FAILURE = 3 | ||||
| PROGRAM_RETVAL_WARNING = 2 | ||||
| PROGRAM_RETVAL_CONNECTION_ERROR = 1 | ||||
| PROGRAM_RETVAL_GOOD = 0 | ||||
| PROGRAM_RETVAL_UNKNOWN_ERROR = -1 | ||||
|  | ||||
| try:  # pragma: nocover | ||||
|     from colorama import init as colorama_init | ||||
| @@ -3516,5 +3517,12 @@ def main() -> int: | ||||
|  | ||||
|  | ||||
| if __name__ == '__main__':  # pragma: nocover | ||||
|     exit_code = main() | ||||
|     exit_code = PROGRAM_RETVAL_GOOD | ||||
|  | ||||
|     try: | ||||
|         exit_code = main() | ||||
|     except Exception: | ||||
|         exit_code = PROGRAM_RETVAL_UNKNOWN_ERROR | ||||
|         print(traceback.format_exc()) | ||||
|  | ||||
|     sys.exit(exit_code) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Joe Testa
					Joe Testa