mirror of
https://github.com/jtesta/ssh-audit.git
synced 2024-12-22 22:15:22 +01:00
Now returns -1 when an uncaught exception is found.
This commit is contained in:
parent
49bd2c96a8
commit
f80e3f22ce
10
ssh-audit.py
10
ssh-audit.py
@ -51,6 +51,7 @@ PROGRAM_RETVAL_FAILURE = 3
|
|||||||
PROGRAM_RETVAL_WARNING = 2
|
PROGRAM_RETVAL_WARNING = 2
|
||||||
PROGRAM_RETVAL_CONNECTION_ERROR = 1
|
PROGRAM_RETVAL_CONNECTION_ERROR = 1
|
||||||
PROGRAM_RETVAL_GOOD = 0
|
PROGRAM_RETVAL_GOOD = 0
|
||||||
|
PROGRAM_RETVAL_UNKNOWN_ERROR = -1
|
||||||
|
|
||||||
try: # pragma: nocover
|
try: # pragma: nocover
|
||||||
from colorama import init as colorama_init
|
from colorama import init as colorama_init
|
||||||
@ -3516,5 +3517,12 @@ def main() -> int:
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__': # pragma: nocover
|
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)
|
sys.exit(exit_code)
|
||||||
|
Loading…
Reference in New Issue
Block a user