summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-08-28 10:24:42 +0000
committerGerrit Code Review <review@openstack.org>2020-08-28 10:24:42 +0000
commit16f19608c446db67e2ad0950a3209078ec6be18b (patch)
treebcd8ea1acd3d7af48dfb8152baba10c2f077791e
parente52e608e35938da27dd9ec7209e4fa858ed8adb6 (diff)
parentd8f740c6a88064f084241296a17583ae79d16bcb (diff)
downloadpbr-5.5.0.tar.gz
Merge "trivial: Improve logging of run commands"5.5.0
-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,)