The Wayback Machine - https://web.archive.org/web/20200917224634/https://github.com/ParallelSSH/parallel-ssh/issues/208
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

Consume output from channel automatically in clients #208

Open
pkittenis opened this issue Aug 27, 2020 · 0 comments
Open

Consume output from channel automatically in clients #208

pkittenis opened this issue Aug 27, 2020 · 0 comments
Labels

Comments

@pkittenis
Copy link
Member

@pkittenis pkittenis commented Aug 27, 2020

Feature Request

Spin off from #207

Native client join requires that consume_output=True be set in order to get exit codes.

The following returns a None exit code:

output = client.run_command('pwd',return_list=True)
client.join(output, consume_output=True)
for host_output in output:
    exitcode = host_output.exit_code
    print(exitcode)
None

Works with consume output:

output = client.run_command('pwd',return_list=True)
client.join(output, consume_output=True)
for host_output in output:
    exitcode = host_output.exit_code
    print(exitcode)
0

By buffering all output automatically in pssh.clients.native.single.SSHClient we can ensure all available output is automatically consumed and make the API simpler to use.

This should be able to get exit code:

output = client.run_command('pwd', return_list=True)
client.join(output)
for host_output in output:
    exitcode = host_output.exit_code
    print(exitcode)
  • Consume output from channel automatically in pssh.clients.native.single.SSHClient by buffering all available output in python side code. This also makes parallel-ssh API consistent regardless of underlying SSH library implementation (libssh/libssh2).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.