Skip to content

Commit bca1a84

Browse files
pkittenisPanos
authored andcommitted
Bug fix when channel has no stdout output
1 parent 81e65df commit bca1a84

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pssh.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,10 @@ def exec_command(self, command, sudo=False, **kwargs):
117117
logger.debug("Running command %s on %s", command, self.host)
118118
channel.exec_command(command, **kwargs)
119119
logger.debug("Command finished executing")
120-
while not channel.recv_ready():
120+
while not (channel.recv_ready() or channel.closed):
121121
gevent.sleep(.2)
122122
return channel, self.host, stdout, stderr
123123

124-
125124
class ParallelSSHClient(object):
126125
"""Uses SSHClient, runs command on multiple hosts in parallel"""
127126

0 commit comments

Comments
 (0)