summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2020-07-09 10:09:29 +0100
committerStephen Finucane <stephenfin@redhat.com>2020-08-06 08:27:41 +0000
commitd8f740c6a88064f084241296a17583ae79d16bcb (patch)
tree15a977bf4cfff84a717503055e6b34e741d309be
parent206b795517a13d759f60ed9605eb03ca785ce10a (diff)
downloadpbr-d8f740c6a88064f084241296a17583ae79d16bcb.tar.gz
trivial: Improve logging of run commands
Change-Id: I5ee1f506a162692fe2882651f7ab68afb441aacf Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
-rw-r--r--pbr/tests/base.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/pbr/tests/base.py b/pbr/tests/base.py
index ea4a458..c94af56 100644
--- a/pbr/tests/base.py
+++ b/pbr/tests/base.py
@@ -202,12 +202,15 @@ def _run_cmd(args, cwd):
:param cwd: The directory to run the comamnd in.
:return: ((stdout, stderr), returncode)
"""
+ print('Running %s' % ' '.join(args))
p = subprocess.Popen(
args, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, cwd=cwd)
streams = tuple(s.decode('latin1').strip() for s in p.communicate())
- for stream_content in streams:
- print(stream_content)
+ print('STDOUT:')
+ print(streams[0])
+ print('STDERR:')
+ print(streams[1])
return (streams) + (p.returncode,)