$ssh->capture not returning partial output when an error occurs. #1

Closed
trcjr opened this Issue May 5, 2012 · 3 comments

Comments

Projects
None yet
2 participants

trcjr commented May 5, 2012

From the POD

When an error happens while capturing (for instance, the operation times out),
the partial captured output will be returned.

$ssh->capture doesn't return partial output if an error occurs.
$ssh->capture2 does return output in $err.

trcjr commented May 5, 2012

Test case and TAP output that illustrates the problem:
https://gist.github.com/2600193

Owner

salva commented May 6, 2012

----- Original Message -----

From: Theodore Robert Campbell Jr reply@reply.github.com
To: Salvador Fandiño sfandino@yahoo.com
Cc:
Sent: Saturday, May 5, 2012 7:52 AM
Subject: [p5-Net-OpenSSH] $ssh->capture not returning partial output when an error occurs. (#1)

From the POD

    When an error happens while capturing (for instance, the operation times
out),
    the partial captured output will be returned.

$ssh->capture doesn't return partial output if an error occurs.

'capture' only captures stdout, if you want to capture both stdout and stderr mixed, then do as follows:

  my $out = $ssh->capture({stderr_to_stdout => 1}, $cmd);

trcjr commented May 7, 2012

Whoops, I should have read the POD better.

trcjr closed this May 7, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment