You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def run(self, command, timeout=0):
"""run a command on the host and return the results"""
self.session.set_timeout(translate_timeout(timeout))
channel = self.session.open_session()
channel.execute(
command,
)
channel.wait_eof()
channel.close()
channel.wait_closed()
results = self._read(channel)
return results
When I run an ssh command that takes long time, I set timeout to e.g. 2000. So execute runs, the command is running. The script continues while the command is still running. The script runs wait_eof which timeouts after 1 second because the command is still running. My specified timeout wasn't actually used and any command that doesn't finish immediately causes this to fail.
The command I was trying to run is for i in {1..60}; do ping -c1 <IP> && exit 0; sleep 20; done; exit 1.
The text was updated successfully, but these errors were encountered:
When I run an ssh command that takes long time, I set timeout to e.g. 2000. So
execute
runs, the command is running. The script continues while the command is still running. The script runswait_eof
which timeouts after 1 second because the command is still running. My specified timeout wasn't actually used and any command that doesn't finish immediately causes this to fail.The command I was trying to run is
for i in {1..60}; do ping -c1 <IP> && exit 0; sleep 20; done; exit 1
.The text was updated successfully, but these errors were encountered: