Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

PARQUET-331: Surface subprocess stderr in merge script #240

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+13 −5
Split
View
@@ -79,11 +79,19 @@ def fail(msg):
def run_cmd(cmd):
- if isinstance(cmd, list):
- return subprocess.check_output(cmd)
- else:
- return subprocess.check_output(cmd.split(" "))
-
+ try:
+ if isinstance(cmd, list):
+ return subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+ else:
+ return subprocess.check_output(cmd.split(" "), stderr = subprocess.STDOUT)
+ except subprocess.CalledProcessError as e:
+ # this avoids hiding the stdout / stderr of failed processes
+ print 'Command failed: %s' % cmd
+ print 'With output:'
+ print '--------------'
+ print e.output
+ print '--------------'
+ raise e
def continue_maybe(prompt):
result = raw_input("\n%s (y/n): " % prompt)