diff --git a/tsshbatch.py b/tsshbatch.py index 936e735..bf721f6 100755 --- a/tsshbatch.py +++ b/tsshbatch.py @@ -9,7 +9,7 @@ PROGNAME = "tsshbatch.py" BASENAME = PROGNAME.split(".py")[0] PROGENV = BASENAME.upper() -RCSID = "$Id: tsshbatch.py,v 1.115 2011/11/04 19:23:32 tundra Exp $" +RCSID = "$Id: tsshbatch.py,v 1.116 2011/11/04 19:32:56 tundra Exp $" VERSION = RCSID.split()[2] @@ -105,7 +105,12 @@ try: ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - ssh.connect(host, username=user, password=pw) + + if KEYEXCHANGE: + ssh.connect(host) + else: + ssh.connect(host, username=user, password=pw) + stdin, stdout, stderr = ssh.exec_command(command) PrintReport([host, SUCCESS] + stdout.readlines() + stderr.readlines()) @@ -234,7 +239,7 @@ # are understood to form the command. else: - CMD = " ".join(args[0:]) + CMD = " ".join(args[0:]) # Iterate over the list of hosts, executing the command