Skip to content

Allow getting exit code without client.join after exhausting output #191

@erpadmin

Description

@erpadmin

Bug reports

Steps to reproduce:
one example below, i've also ran a simple remote shell script with exit 1 call in it and the exit code is 0

from pssh.clients import ParallelSSHClient

host='myhost.localnet'
client = ParallelSSHClient([host], user=someuser)

output = client.run_command('bash -c \"exit 1\"')
for host, host_output in output.items():
    for line in host_output.stdout:
        print(line)

    stderr = ''.join(host_output.stderr)
    if stderr:
        print("STDERR: {}".format(stderr))

    retval = output[host].exit_code
    print("retval: {}".format(retval))

Expected behaviour: [What was expected to happen.]
retval should be 1
Actual behaviour: [What actually happened.]
retval is 0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions