diff --git a/tsshbatch.py b/tsshbatch.py index 4415637..274c0e8 100755 --- a/tsshbatch.py +++ b/tsshbatch.py @@ -20,7 +20,7 @@ CMDINCL = PROGENV + "CMDS" HOSTINCL = PROGENV + "HOSTS" -CVSID = "$Id: tsshbatch.py,v 1.181 2014/03/28 20:32:12 tundra Exp $" +CVSID = "$Id: tsshbatch.py,v 1.182 2014/03/28 20:47:43 tundra Exp $" VERSION = CVSID.split()[2] CPRT = "(c)" DATE = "2011-2014" @@ -64,7 +64,6 @@ COMMENT = '#' COMMANDS = 'Commands' CONSUCCESS = 'SUCCESS: Connection Established' -FAILURE = 'FAILURE: %s' GETFILES = 'Files To GET' HOSTSEP = ':' HOSTNOISE = '[%s]' @@ -143,7 +142,8 @@ eBADTXRQ = "Bad Transfer Request: %s Must Have Exactly 1 Source And 1 Destination!" eBADDEFINE = "Bad Symbol Definition: %s" eBADTIMEOUT = "Timeout Value Must Be an Integer!" -eFXERROR = "%s File Transfer Error: %s" +eCMDFAILURE = "Failed To Run Command(s): %s" +eFXERROR = "File Transfer Error: %s" eINCLUDECYCLE = "Circular Include At: %s" eNOCONNECT = "Cannot Connect: %s" eNOHOSTS = "No Hosts Specified!" @@ -291,7 +291,8 @@ ssh.close() except: - ErrorExit(eFXERROR % (host, str(sys.exc_info()[1]))) + + PrintReport([host, eFXERROR % str(sys.exc_info()[1])], HANDLER=PrintStderr) try: sftp.close() @@ -358,7 +359,7 @@ sudonoise = " ".join(stderr.readline().split(SUDOPROMPT)).strip() if sudonoise: # sudo had problems - PrintReport([host + " [%s]" % command, FAILURE % (eBADSUDO % sudonoise)] + ["\n"], HANDLER=PrintStderr) + PrintReport([host + " [%s]" % command, eCMDFAILURE % (eBADSUDO % sudonoise)] + ["\n"], HANDLER=PrintStderr) ssh.close() raise SystemExit @@ -375,12 +376,12 @@ # Catch authentication problems explicitly except paramiko.AuthenticationException: - PrintReport([host, FAILURE % eNOLOGIN], HANDLER=PrintStderr) + PrintReport([host, eCMDFAILURE % eNOLOGIN], HANDLER=PrintStderr) # Everything else is some kind of connection problem except: - PrintReport([host, FAILURE % (eNOCONNECT % str(sys.exc_info()[1]))], HANDLER=PrintStderr) + PrintReport([host, eCMDFAILURE % (eNOCONNECT % str(sys.exc_info()[1]))], HANDLER=PrintStderr) ssh.close()