Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssh timeouts regardless of desired timeout specified #161

Closed
lhellebr opened this issue Aug 4, 2022 · 1 comment
Closed

ssh timeouts regardless of desired timeout specified #161

lhellebr opened this issue Aug 4, 2022 · 1 comment

Comments

@lhellebr
Copy link

lhellebr commented Aug 4, 2022

    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.

@JacobCallahan
Copy link
Member

Should be fixed by #210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants