You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ma...@apache.org on 2016/02/24 22:13:36 UTC

[18/50] [abbrv] phoenix git commit: PHOENIX-2659 Incorrect argument parsing and bad command for queryserver.py (Josh Elser)

PHOENIX-2659 Incorrect argument parsing and bad command for
 queryserver.py (Josh Elser)


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

Branch: refs/heads/calcite
Commit: 0c1fd3ad503207079bd20fc0d04c0409280c305b
Parents: 980eb36
Author: James Taylor <jt...@salesforce.com>
Authored: Fri Feb 12 10:57:23 2016 -0800
Committer: James Taylor <jt...@salesforce.com>
Committed: Fri Feb 12 10:57:23 2016 -0800

----------------------------------------------------------------------
 bin/queryserver.py | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/0c1fd3ad/bin/queryserver.py
----------------------------------------------------------------------
diff --git a/bin/queryserver.py b/bin/queryserver.py
index d4228b3..c80e629 100755
--- a/bin/queryserver.py
+++ b/bin/queryserver.py
@@ -55,14 +55,19 @@ if len(args) > 1:
         command = 'stop'
     elif args[1] == 'makeWinServiceDesc':
         command = 'makeWinServiceDesc'
+
 if command:
+    # Pull off queryserver.py and the command
     args = args[2:]
+else:
+    # Just pull off queryserver.py
+    args = args[1:]
 
 if os.name == 'nt':
-    args = subprocess.list2cmdline(args[1:])
+    args = subprocess.list2cmdline(args)
 else:
     import pipes    # pipes module isn't available on Windows
-    args = " ".join([pipes.quote(v) for v in args[1:]])
+    args = " ".join([pipes.quote(v) for v in args])
 
 # HBase configuration folder path (where hbase-site.xml reside) for
 # HBase/Phoenix client side property override
@@ -119,7 +124,9 @@ else:
 
 #    " -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n " + \
 #    " -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:FlightRecorderOptions=defaultrecording=true,dumponexit=true" + \
-java_cmd = '%(java)s $PHOENIX_OPTS -cp ' + hbase_config_path + os.pathsep + hadoop_config_path + os.pathsep + \
+
+# The command is run through subprocess so environment variables are automatically inherited
+java_cmd = '%(java)s -cp ' + hbase_config_path + os.pathsep + hadoop_config_path + os.pathsep + \
     phoenix_utils.phoenix_queryserver_jar + os.pathsep + phoenix_utils.phoenix_client_jar + \
     " -Dproc_phoenixserver" + \
     " -Dlog4j.configuration=file:" + os.path.join(phoenix_utils.current_dir, "log4j.properties") + \
@@ -201,5 +208,6 @@ elif command == 'stop':
 else:
     # run in the foreground using defaults from log4j.properties
     cmd = java_cmd % {'java': java, 'root_logger': 'INFO,console', 'log_dir': '.', 'log_file': 'psql.log'}
+    # Because shell=True is not set, we don't have to alter the environment
     child = subprocess.Popen(cmd.split())
     sys.exit(child.wait())