Repository: phoenix
Updated Branches:
  refs/heads/master 6d68a511f -> afa9dee2b


PHOENIX-2515 Fix error if Hadoop not installed

Don't log an error in bin scripts when looking for the
Hadoop classpath if Hadoop isn't installed.


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

Branch: refs/heads/master
Commit: afa9dee2be618cca8bd43a11311aea2062fa551c
Parents: 6d68a51
Author: Gabriel Reid <[email protected]>
Authored: Fri Dec 11 13:50:47 2015 +0100
Committer: Gabriel Reid <[email protected]>
Committed: Sun Dec 13 07:05:01 2015 +0100

----------------------------------------------------------------------
 bin/phoenix_utils.py | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/afa9dee2/bin/phoenix_utils.py
----------------------------------------------------------------------
diff --git a/bin/phoenix_utils.py b/bin/phoenix_utils.py
index 5fb4f08..6b00d5f 100755
--- a/bin/phoenix_utils.py
+++ b/bin/phoenix_utils.py
@@ -53,15 +53,18 @@ def findFileInPathWithoutRecursion(pattern, path):
 
     return ""
 
-def which(file):
+def which(command):
     for path in os.environ["PATH"].split(os.pathsep):
-        if os.path.exists(os.path.join(path, file)):
-            return os.path.join(path, file)
+        if os.path.exists(os.path.join(path, command)):
+            return os.path.join(path, command)
     return None
 
-def findClasspath(file):
-    aPath = which(file)
-    command = "%s%s" %(aPath, ' classpath')
+def findClasspath(command_name):
+    command_path = which(command_name)
+    if command_path is None:
+        # We don't have this command, so we can't get its classpath
+        return ''
+    command = "%s%s" %(command_path, ' classpath')
     return subprocess.Popen(command, shell=True, 
stdout=subprocess.PIPE).stdout.read()
 
 def setPath():

Reply via email to