diff --git a/tsshbatch.py b/tsshbatch.py index c8bd885..fb0d62b 100755 --- a/tsshbatch.py +++ b/tsshbatch.py @@ -17,7 +17,7 @@ PROGNAME = "tsshbatch.py" BASENAME = PROGNAME.split(".py")[0] PROGENV = BASENAME.upper() -CVSID = "$Id: tsshbatch.py,v 1.150 2013/10/23 15:24:09 tundra Exp $" +CVSID = "$Id: tsshbatch.py,v 1.151 2013/10/23 15:54:12 tundra Exp $" VERSION = CVSID.split()[2] CPRT = "(c)" @@ -58,6 +58,7 @@ ##### +ABORTING = "Aborting ..." COMMENT = "#" CONSUCCESS = "SUCCESS: Connection Established" FAILURE = "FAILURE: %s" @@ -256,13 +257,18 @@ if sudonoise: # sudo had problems PrintReport([host + " [%s]" % command, FAILURE % (eBADSUDO % sudonoise)] + ["\n"], HANDLER=PrintStderr) ssh.close() - return + raise SystemExit PrintReport([host + " (stdout)" + " [%s]" % command, "\n"] + stdout.readlines() + ["\n"]) if REPORTERR: PrintReport([host + " (stderr)" + " [%s]" % command, "\n"] + stderr.readlines() + ["\n"], HANDLER=PrintStderr) + # Handle aborts + + except SystemExit: + ErrorExit(ABORTING) + # Catch authentication problems explicitly except paramiko.AuthenticationException: