Ich versuche parallel ssh auf Servern zu tun. Währenddessen bekomme ich "TypeError: 'NoneType' Objekt ist nicht iterierbar" diesen Fehler. Freundlich helfen.Getting "TypeError: 'NoneType' -Objekt ist nicht iterierbar" Parallele ssh
Mein Skript ist unter
from pssh import ParallelSSHClient
from pssh.exceptions import AuthenticationException, UnknownHostException, ConnectionErrorException
def parallelsshjob():
client = ParallelSSHClient(['10.84.226.72','10.84.226.74'], user = 'root', password = 'XXX')
try:
output = client.run_command('racadm getsvctag', sudo=True)
print output
except (AuthenticationException, UnknownHostException, ConnectionErrorException):
pass
#print output
if __name__ == '__main__':
parallelsshjob()
Und die Traceback ist unter
Traceback (most recent call last):
File "parallelssh.py", line 17, in <module>
parallelsshjob()
File "parallelssh.py", line 10, in parallelsshjob
output = client.run_command('racadm getsvctag', sudo=True)
File "/Library/Python/2.7/site-packages/pssh/pssh_client.py", line 520, in run_command
raise ex
TypeError: 'NoneType' object is not iterable
mir Hilfe mit der Lösung und schlagen mir auch ssh-agent in demselben Skript zu verwenden. Danke im Voraus.