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

2016-02-12 Thread jamestaylor
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/fd757a05
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/fd757a05
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/fd757a05

Branch: refs/heads/4.x-HBase-1.0
Commit: fd757a055670592ae89eb7fcac6bc128c87131c4
Parents: 9d3e8ef
Author: James Taylor 
Authored: Fri Feb 12 10:57:23 2016 -0800
Committer: James Taylor 
Committed: Fri Feb 12 11:05:42 2016 -0800

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


http://git-wip-us.apache.org/repos/asf/phoenix/blob/fd757a05/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())



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

2016-02-12 Thread jamestaylor
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/03b1dd22
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/03b1dd22
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/03b1dd22

Branch: refs/heads/4.x-HBase-0.98
Commit: 03b1dd22933d677b664a98a3ed499c7c4ec03635
Parents: 86222d8
Author: James Taylor 
Authored: Fri Feb 12 10:57:23 2016 -0800
Committer: James Taylor 
Committed: Fri Feb 12 11:01:22 2016 -0800

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


http://git-wip-us.apache.org/repos/asf/phoenix/blob/03b1dd22/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())