summaryrefslogtreecommitdiff
path: root/tools/patman/command.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-07-25 18:59:00 -0600
committerSimon Glass <sjg@chromium.org>2016-09-18 21:04:38 -0600
commit785f1548a9e74cf4796c96e6f32ed67b25f79b81 (patch)
tree33e5bf6ef78a66caf34372759283f3affb6a0f86 /tools/patman/command.py
parent49afb37988a397ce215e99563e0ab5d2970c6a39 (diff)
downloadu-boot-imx-785f1548a9e74cf4796c96e6f32ed67b25f79b81.zip
u-boot-imx-785f1548a9e74cf4796c96e6f32ed67b25f79b81.tar.gz
u-boot-imx-785f1548a9e74cf4796c96e6f32ed67b25f79b81.tar.bz2
patman: Adjust command.Output() to raise an error by default
It is more useful to have this method raise an error when something goes wrong. Make this the default and adjust the few callers that don't want to use it this way. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman/command.py')
-rw-r--r--tools/patman/command.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/patman/command.py b/tools/patman/command.py
index d586f11..d1f0ca5 100644
--- a/tools/patman/command.py
+++ b/tools/patman/command.py
@@ -104,8 +104,9 @@ def RunPipe(pipe_list, infile=None, outfile=None,
raise Exception("Error running '%s'" % user_pipestr)
return result
-def Output(*cmd):
- return RunPipe([cmd], capture=True, raise_on_error=False).stdout
+def Output(*cmd, **kwargs):
+ raise_on_error = kwargs.get('raise_on_error', True)
+ return RunPipe([cmd], capture=True, raise_on_error=raise_on_error).stdout
def OutputOneLine(*cmd, **kwargs):
raise_on_error = kwargs.pop('raise_on_error', True)