diff --git a/tsshbatch.py b/tsshbatch.py index 846e122..4a39004 100755 --- a/tsshbatch.py +++ b/tsshbatch.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # Non-Interactive ssh Connection -# $Id: tsshbatch.py,v 1.109 2010/12/15 21:18:35 tundra Exp $ +# $Id: tsshbatch.py,v 1.110 2010/12/17 18:39:48 tundra Exp $ ##### # Suppress Deprecation Warnings until Paramiko catches up @@ -88,13 +88,14 @@ stdin, stdout, stderr = ssh.exec_command(command) PrintReport([host, SUCCESS] + stdout.readlines() + stderr.readlines()) + # Catch authentication problems explicitly + except paramiko.AuthenticationException: PrintReport([host, FAILURE, eNOLOGIN]) - except socket.gaierror: - PrintReport([host, FAILURE, eNOCONNECT]) - - except socket.error: + # Everything else is some kind of connection problem + + except: PrintReport([host, FAILURE, eNOCONNECT]) ssh.close()