Repository: phoenix Updated Branches: refs/heads/4.x-HBase-0.98 aec4587fd -> 265e51cbc
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/265e51cb Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/265e51cb Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/265e51cb Branch: refs/heads/4.x-HBase-0.98 Commit: 265e51cbc4fe2cf36f8b440981187fc60b4662b0 Parents: aec4587 Author: Gabriel Reid <gabri...@ngdata.com> Authored: Fri Dec 11 13:50:47 2015 +0100 Committer: Gabriel Reid <gr...@apache.org> Committed: Sun Dec 13 07:05:10 2015 +0100 ---------------------------------------------------------------------- bin/phoenix_utils.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/265e51cb/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():