Feature #55

avatar

Allow access to captured stderr from operations

Added by Jeff Forcier 384 days ago. Updated 304 days ago.

Status:Done Start:08/20/2009
Priority:Normal Due date:
Assigned to:avatarJeff Forcier % Done:

100%

Category:Operations
Target version:1.0

Description

stdout is currently captured and returned; stderr is simply discarded. There’s a few ways we can go here to help folks who want access to stderr:

  1. When the command’s return code is zero, return stderr instead of stdout, otherwise no change. This would be the easiest to implement but possibly confusing to unexpecting users.
  2. Return value is always stdout, but stderr is attached as another attribute alongside .failed and .return_code. A little funny, but preserves the “single string return value” which I feel is relatively important, see no. 3.
  3. Return both as a tuple, i.e. stdout, stderr = run('foo') would become possible. Don’t like this as much because then the return value always evaluates to True. Could make this behavior toggle-able (i.e. normally it behaves as now, one could do env.return_both=True, now the operations return the tuples instead) but that’s possibly even worse.

Right now I'm favoring no. 2 but am open to feedback.

Associated revisions

Revision d3307a3413ea634f146ac8f9770a899414a03bad
Added by Jeff Forcier 371 days ago

Implements #55 — run/sudo/local all capture stderr

History

Updated by Jeff Forcier 371 days ago

avatar
  • Status changed from New to Done
  • % Done changed from 0 to 100

Updated by Jeff Forcier 304 days ago

avatar
  • Category set to Operations

Also available in: Atom