You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ja...@apache.org on 2014/10/29 01:02:04 UTC
[09/15] git commit: PHOENIX-897 Quote parameters in psql.py
PHOENIX-897 Quote parameters in psql.py
Properly quote supplied command-line parameters in psql.py so that
it's possible to supply any character (including ones that have
special meanings in various shells) as parameters.
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/f4687599
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/f4687599
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/f4687599
Branch: refs/heads/3.2
Commit: f4687599173427d2b7e71b076aa1e763a062281b
Parents: ca6c08f
Author: Gabriel Reid <ga...@ngdata.com>
Authored: Mon Oct 27 10:57:43 2014 +0100
Committer: Gabriel Reid <ga...@ngdata.com>
Committed: Mon Oct 27 10:58:48 2014 +0100
----------------------------------------------------------------------
bin/psql.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/f4687599/bin/psql.py
----------------------------------------------------------------------
diff --git a/bin/psql.py b/bin/psql.py
index a8cbe31..34a95df 100755
--- a/bin/psql.py
+++ b/bin/psql.py
@@ -26,11 +26,17 @@ import phoenix_utils
phoenix_utils.setPath()
+if os.name == 'nt':
+ args = subprocess.list2cmdline(sys.argv[1:])
+else:
+ import pipes # pipes module isn't available on Windows
+ args = " ".join([pipes.quote(v) for v in sys.argv[1:]])
+
# HBase configuration folder path (where hbase-site.xml reside) for
# HBase/Phoenix client side property override
java_cmd = 'java -cp "' + phoenix_utils.hbase_conf_path + os.pathsep + phoenix_utils.phoenix_client_jar + \
'" -Dlog4j.configuration=file:' + \
os.path.join(phoenix_utils.current_dir, "log4j.properties") + \
- " org.apache.phoenix.util.PhoenixRuntime " + ' '.join(sys.argv[1:])
+ " org.apache.phoenix.util.PhoenixRuntime " + args
subprocess.call(java_cmd, shell=True)