Return-Path: X-Original-To: apmail-phoenix-commits-archive@minotaur.apache.org Delivered-To: apmail-phoenix-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F2C081728C for ; Mon, 1 Jun 2015 18:53:03 +0000 (UTC) Received: (qmail 20607 invoked by uid 500); 1 Jun 2015 18:53:03 -0000 Delivered-To: apmail-phoenix-commits-archive@phoenix.apache.org Received: (qmail 20569 invoked by uid 500); 1 Jun 2015 18:53:03 -0000 Mailing-List: contact commits-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list commits@phoenix.apache.org Received: (qmail 20560 invoked by uid 99); 1 Jun 2015 18:53:03 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2015 18:53:03 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 86B21E0593; Mon, 1 Jun 2015 18:53:03 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ndimiduk@apache.org To: commits@phoenix.apache.org Message-Id: <62586f30d6ab41679418f2ea647be012@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: phoenix git commit: PHOENIX-1990 bin/queryserver makeWinServiceDesc doesn't actually work in Windows Date: Mon, 1 Jun 2015 18:53:03 +0000 (UTC) Repository: phoenix Updated Branches: refs/heads/4.4-HBase-1.1 cbf00bc2d -> 404419721 PHOENIX-1990 bin/queryserver makeWinServiceDesc doesn't actually work in Windows Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/40441972 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/40441972 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/40441972 Branch: refs/heads/4.4-HBase-1.1 Commit: 404419721579f51ce1d91b5afac6fa872cd32345 Parents: cbf00bc Author: Nick Dimiduk Authored: Mon May 18 16:00:31 2015 -0700 Committer: Nick Dimiduk Committed: Mon Jun 1 11:50:40 2015 -0700 ---------------------------------------------------------------------- bin/queryserver.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/40441972/bin/queryserver.py ---------------------------------------------------------------------- diff --git a/bin/queryserver.py b/bin/queryserver.py index 6a18741..7666246 100755 --- a/bin/queryserver.py +++ b/bin/queryserver.py @@ -78,11 +78,22 @@ phoenix_out_file = '%s.out' % phoenix_file_basename phoenix_pid_file = '%s.pid' % phoenix_file_basename opts = os.getenv('PHOENIX_QUERYSERVER_OPTS', '') -# load hbase-env.sh to extract JAVA_HOME, HBASE_PID_DIR, HBASE_LOG_DIR -hbase_env_path = os.path.join(hbase_config_path, 'hbase-env.sh') +# load hbase-env.??? to extract JAVA_HOME, HBASE_PID_DIR, HBASE_LOG_DIR +hbase_env_path = None +hbase_env_cmd = None +if os.name == 'posix': + hbase_env_path = os.path.join(hbase_config_path, 'hbase-env.sh') + hbase_env_cmd = ['bash', '-c', 'source %s && env' % hbase_env_path] +elif os.name == 'nt': + hbase_env_path = os.path.join(hbase_config_path, 'hbase-env.cmd') + hbase_env_cmd = ['cmd.exe', '/c', 'call %s & set' % hbase_env_path] +if not hbase_env_path or not hbase_env_cmd: + print >> sys.stderr, "hbase-env file unknown on platform %s" % os.name + sys.exit(-1) + hbase_env = {} if os.path.isfile(hbase_env_path): - p = subprocess.Popen(['bash', '-c', 'source %s && env' % hbase_env_path], stdout = subprocess.PIPE) + p = subprocess.Popen(hbase_env_cmd, stdout = subprocess.PIPE) for x in p.stdout: (k, _, v) = x.partition('=') hbase_env[k.strip()] = v.strip()