Propagate stderr from child process.
authorTom Clegg <tom@curoverse.com>
Wed, 26 Jul 2017 17:17:44 +0000 (13:17 -0400)
committerTom Clegg <tom@curoverse.com>
Wed, 26 Jul 2017 17:19:15 +0000 (13:19 -0400)
No issue #

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curoverse.com>

jenkins/run_upload_packages.py

index fd229439e6bc239809ed9aabf11d00b5cfd71240..ee3f8d21057ff99f87ea041b7cda717662210cba 100755 (executable)
@@ -38,8 +38,12 @@ def run_and_grep(cmd, read_output, *regexps,
     popen_kwargs[read_output] = subprocess.PIPE
     proc = subprocess.Popen(cmd, **popen_kwargs)
     with open(getattr(proc, read_output).fileno(), encoding=encoding) as output:
-        matched_lines = [line for line in output
-                         if any(regexp.search(line) for regexp in regexps)]
+        matched_lines = []
+        for line in output:
+            if any(regexp.search(line) for regexp in regexps):
+                matched_lines.append(line)
+            if read_output == 'stderr':
+                print(line, file=sys.stderr, end='')
     return proc.wait(), matched_lines