updated to vnode on how commands are ran, updated all functions to capture output and raise exceptions when commands fail

This commit is contained in:
Blake J. Harnden 2018-03-01 09:17:58 -08:00
parent 719670c895
commit 908fb777de
3 changed files with 104 additions and 51 deletions

View file

@ -125,6 +125,19 @@ def mutecall(*args, **kwargs):
return subprocess.call(*args, **kwargs)
def check_alloutput(cmd, **kwargs):
"""
Convenience wrapper to run subprocess.check_output and include stderr as well.
:param list[str] cmd: command arguments to run
:param dict kwargs: option for running subprocess.check_output, beyond setting stderr to stdout
:return: combined stdout and stderr
:raises subprocess.CalledProcessError: when a non-zero exit status is encountered
"""
kwargs["stderr"] = subprocess.STDOUT
return subprocess.check_output(cmd, **kwargs)
def mutecheck_call(*args, **kwargs):
"""
Run a muted check call command.