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

failing to execute consecutive commands on a remote host #42

Closed
mohsen1565 opened this issue Nov 9, 2018 · 3 comments
Closed

failing to execute consecutive commands on a remote host #42

mohsen1565 opened this issue Nov 9, 2018 · 3 comments
Labels

Comments

@mohsen1565
Copy link

After testing, I realized that, every time a command is executed on a remote server the session needs to be closed and reopened before running the next command.
Can you please investigate?

@t-cas t-cas added the bug label Nov 9, 2018
@t-cas
Copy link
Contributor

t-cas commented Nov 9, 2018

this is not the expected behavior, a session remains opened until:

  • you explicitely call close on SSHSession instance
  • SSHSession instance is garbage collected
  • underlying ssh connection is closed by remote host (so SSHSession becomes inactive)

see several tests in which we call multiple successive run_cmd on a single SSHSession instance: https://github.com/AmadeusITGroup/JumpSSH/blob/master/tests/test_session.py#L127

If you are not in one of those cases, please provide a code example having this issue so that we can troubleshoot further.

@t-cas t-cas added question and removed bug labels Nov 9, 2018
@mohsen1565
Copy link
Author

mohsen1565 commented Nov 11, 2018 via email

@t-cas
Copy link
Contributor

t-cas commented Nov 16, 2018

From what I can see looking a bit around, this seems to be a common issue with Cisco devices that apparently only allow one exec command execution per connection:

if you don't have any issue with the latency introduced when reopening the session for each command, I think it will be the easiest approach.

@t-cas t-cas closed this as completed Dec 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants