Skip to content

Commit de75c7b

Browse files
author
Dan
committed
Make sure host clients dict has key for host when running command
1 parent 6603c13 commit de75c7b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pssh/pssh_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ def exec_command(self, *args, **kwargs):
336336

337337
def _exec_command(self, host, *args, **kwargs):
338338
"""Make SSHClient, run command on host"""
339-
if not self.host_clients[host]:
339+
if not host in self.host_clients or not self.host_clients[host]:
340340
self.host_clients[host] = SSHClient(host, user=self.user,
341341
password=self.password,
342342
port=self.port, pkey=self.pkey,

0 commit comments

Comments
 (0)