PHOENIX-1975 Detect and use HBASE_HOME when set

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

Branch: refs/heads/4.x-HBase-1.1
Commit: 980d29c5acf785dc90ece1a7f047711e8d522a2e
Parents: 05b1b8b
Author: Nick Dimiduk <ndimi...@apache.org>
Authored: Wed Jun 24 13:59:00 2015 -0700
Committer: Nick Dimiduk <ndimi...@apache.org>
Committed: Wed Jun 24 13:59:28 2015 -0700

----------------------------------------------------------------------
 bin/phoenix_utils.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/980d29c5/bin/phoenix_utils.py
----------------------------------------------------------------------
diff --git a/bin/phoenix_utils.py b/bin/phoenix_utils.py
index 383e0e1..bfb4737 100755
--- a/bin/phoenix_utils.py
+++ b/bin/phoenix_utils.py
@@ -65,7 +65,15 @@ def setPath():
         phoenix_class_path = os.getenv('PHOENIX_CLASS_PATH','')
 
     global hbase_conf_dir
-    hbase_conf_dir = os.getenv('HBASE_CONF_DIR', os.getenv('HBASE_CONF_PATH', 
'.'))
+    # if HBASE_CONF_DIR set explicitly, use that
+    hbase_conf_dir = os.getenv('HBASE_CONF_DIR', os.getenv('HBASE_CONF_PATH'))
+    if not hbase_conf_dir:
+        # else fall back to HBASE_HOME
+        if os.getenv('HBASE_HOME'):
+            hbase_conf_dir = os.path.join(os.getenv('HBASE_HOME'), "conf")
+        else:
+            # default to pwd
+            hbase_conf_dir = '.'
     global hbase_conf_path # keep conf_path around for backward compatibility
     hbase_conf_path = hbase_conf_dir
 

Reply via email to