sshkit: Fix handling of output streams, including in cases of error.
In SSHKit we do some weird stuff with stream handling depending on the packets (sic) we receive back from Net::SSH.
I’d like to write a test case script that produces buffered, and unbuffered output, line- and character-wise, on standard error, and standard out to test the correct usage.
With a pathologically badly behaved script, we could find a way to make this work reliably, I am sure.
About this issue
- Original URL
- State: open
- Created 10 years ago
- Comments: 25 (14 by maintainers)
@daniel-gomes-sociomantic I may have misunderstood the problem here, but there is an option which can be applied to commands to stop non zero commands from raising an exception:
raise_on_non_zero_exit: false. The command output is collected in thefull_stderrandfull_stdoutattrs of the command object.On SSHKit master, you could patch something like this on to the abstract back end (based on a mixture of the test and capture methods:
Does this help?