Feature #55
Allow access to captured stderr from operations
| Status: | Done | Start: | 08/20/2009 | |
| Priority: | Normal | Due date: | ||
| Assigned to: | % 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:
- 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.
- Return value is always stdout, but stderr is attached as another attribute alongside
.failedand.return_code. A little funny, but preserves the “single string return value” which I feel is relatively important, see no. 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 toTrue. Could make this behavior toggle-able (i.e. normally it behaves as now, one could doenv.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
Implements #55 — run/sudo/local all capture stderr
History
Updated by Jeff Forcier 371 days ago
- Status changed from New to Done
- % Done changed from 0 to 100
Applied in changeset d3307a3413ea634f146ac8f9770a899414a03bad.
Also available in: Atom