Repository: phoenix
Updated Branches:
  refs/heads/master f941e89f4 -> 1a1378422


PHOENIX-1770 Correct exit code from bin scripts

Make the python scripts under bin/ exit with the exit code that
was returned from the underlying java command.

Contributed by Mark Tse.


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/1a137842
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/1a137842
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/1a137842

Branch: refs/heads/master
Commit: 1a13784228f05ebe51e52ad80ae464d8531c2fe0
Parents: f941e89
Author: Gabriel Reid <gabri...@ngdata.com>
Authored: Thu Mar 26 08:43:48 2015 +0100
Committer: Gabriel Reid <gabri...@ngdata.com>
Committed: Thu Mar 26 08:45:49 2015 +0100

----------------------------------------------------------------------
 bin/end2endTest.py |  3 ++-
 bin/performance.py | 13 ++++++++++---
 bin/psql.py        |  3 ++-
 3 files changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/1a137842/bin/end2endTest.py
----------------------------------------------------------------------
diff --git a/bin/end2endTest.py b/bin/end2endTest.py
index 96886c7..a5993dc 100755
--- a/bin/end2endTest.py
+++ b/bin/end2endTest.py
@@ -44,4 +44,5 @@ java_cmd = "java -cp " + hbase_config_path + os.pathsep + 
phoenix_jar_path + os.
     hbase_library_path + " org.apache.phoenix.end2end.End2EndTestDriver " + \
     ' '.join(sys.argv[1:])
 
-subprocess.call(java_cmd, shell=True)
+exitcode = subprocess.call(java_cmd, shell=True)
+sys.exit(exitcode)

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1a137842/bin/performance.py
----------------------------------------------------------------------
diff --git a/bin/performance.py b/bin/performance.py
index c69edfd..b9df433 100755
--- a/bin/performance.py
+++ b/bin/performance.py
@@ -85,7 +85,9 @@ print "-----------------------------------------"
 print "\nCreating performance table..."
 createFileWithContent(ddl, createtable)
 
-subprocess.call(execute + ddl, shell=True)
+exitcode = subprocess.call(execute + ddl, shell=True)
+if exitcode != 0:
+    sys.exit(exitcode)
 
 # Write real,user,sys time on console for the following queries
 queryex("1 - Count", "SELECT COUNT(1) FROM %s;" % (table))
@@ -95,11 +97,16 @@ queryex("4 - Truncate + Group By", "SELECT 
TRUNC(DATE,'DAY') DAY FROM %s GROUP B
 queryex("5 - Filter + Count", "SELECT COUNT(1) FROM %s WHERE CORE<10;" % 
(table))
 
 print "\nGenerating and upserting data..."
-subprocess.call('java -jar %s %s' % (phoenix_utils.testjar, rowcount), 
shell=True)
+exitcode = subprocess.call('java -jar %s %s' % (phoenix_utils.testjar, 
rowcount), shell=True)
+if exitcode != 0:
+    sys.exit(exitcode)
+
 print "\n"
 createFileWithContent(qry, statements)
 
-subprocess.call(execute + data + ' ' + qry, shell=True)
+exitcode = subprocess.call(execute + data + ' ' + qry, shell=True)
+if exitcode != 0:
+    sys.exit(exitcode)
 
 # clear temporary files
 delfile(ddl)

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1a137842/bin/psql.py
----------------------------------------------------------------------
diff --git a/bin/psql.py b/bin/psql.py
index 34a95df..247001a 100755
--- a/bin/psql.py
+++ b/bin/psql.py
@@ -39,4 +39,5 @@ java_cmd = 'java -cp "' + phoenix_utils.hbase_conf_path + 
os.pathsep + phoenix_u
     os.path.join(phoenix_utils.current_dir, "log4j.properties") + \
     " org.apache.phoenix.util.PhoenixRuntime " + args 
 
-subprocess.call(java_cmd, shell=True)
+exitcode = subprocess.call(java_cmd, shell=True)
+sys.exit(exitcode)

Reply via email to