parquet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexleven...@apache.org
Subject parquet-mr git commit: PARQUET-331: Surface subprocess stderr in merge script
Date Tue, 14 Jul 2015 16:56:23 GMT
Repository: parquet-mr
Updated Branches:
  refs/heads/master fcd568282 -> be9f3cb2a


PARQUET-331: Surface subprocess stderr in merge script

This makes it a little easier to understand why the merge script failed

Author: Alex Levenson <alexlevenson@twitter.com>

Closes #240 from isnotinvain/alexlevenson/merge-script-error-handling and squashes the following
commits:

7c38c01 [Alex Levenson] Surface subprocess stderr in merge script


Project: http://git-wip-us.apache.org/repos/asf/parquet-mr/repo
Commit: http://git-wip-us.apache.org/repos/asf/parquet-mr/commit/be9f3cb2
Tree: http://git-wip-us.apache.org/repos/asf/parquet-mr/tree/be9f3cb2
Diff: http://git-wip-us.apache.org/repos/asf/parquet-mr/diff/be9f3cb2

Branch: refs/heads/master
Commit: be9f3cb2a8095c89b5a11c33a498532f3c6413a3
Parents: fcd5682
Author: Alex Levenson <alexlevenson@twitter.com>
Authored: Tue Jul 14 09:56:20 2015 -0700
Committer: Alex Levenson <alexlevenson@twitter.com>
Committed: Tue Jul 14 09:56:20 2015 -0700

----------------------------------------------------------------------
 dev/merge_parquet_pr.py | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/be9f3cb2/dev/merge_parquet_pr.py
----------------------------------------------------------------------
diff --git a/dev/merge_parquet_pr.py b/dev/merge_parquet_pr.py
index 8ebd887..621fcde 100755
--- a/dev/merge_parquet_pr.py
+++ b/dev/merge_parquet_pr.py
@@ -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)


Mime
View raw message