Repository: ambari Updated Branches: refs/heads/branch-2.1 2d9612e9f -> bb877b81a refs/heads/trunk 49c052e59 -> 85c87bffa
AMBARI-12912. Python Wrapper Can Choose Two Different Python Versions (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/85c87bff Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/85c87bff Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/85c87bff Branch: refs/heads/trunk Commit: 85c87bffae1d24d0aeb0170427b8dd775b23f79b Parents: 49c052e Author: Andrew Onishuk <aonis...@hortonworks.com> Authored: Fri Aug 28 12:28:21 2015 +0300 Committer: Andrew Onishuk <aonis...@hortonworks.com> Committed: Fri Aug 28 12:28:21 2015 +0300 ---------------------------------------------------------------------- ambari-common/src/main/unix/ambari-python-wrap | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/85c87bff/ambari-common/src/main/unix/ambari-python-wrap ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/unix/ambari-python-wrap b/ambari-common/src/main/unix/ambari-python-wrap index b9cf3b6..efc073b 100755 --- a/ambari-common/src/main/unix/ambari-python-wrap +++ b/ambari-common/src/main/unix/ambari-python-wrap @@ -22,16 +22,20 @@ export PYTHONPATH=/usr/lib/python2.6/site-packages:/usr/lib/python2.6/site-packa # reset settings unset PYTHON -# checking for preferable python versions -if [ -a /usr/bin/python2.7 ] && [ -z "$PYTHON" ]; then - PYTHON=/usr/bin/python2.7 +# checking for default Python 2 +if [ -a /usr/bin/python2 ] && [ -z "$PYTHON" ]; then + PYTHON=/usr/bin/python2 fi if [ -a /usr/bin/python2.6 ] && [ -z "$PYTHON" ]; then PYTHON=/usr/bin/python2.6 fi -# if no preferable python versions found, try to use system one +if [ -a /usr/bin/python2.7 ] && [ -z "$PYTHON" ]; then + PYTHON=/usr/bin/python2.7 +fi + +# if no preferable python versions found, try to use system one. Hoping it's Python 2 if [[ -z "$PYTHON" ]]; then PYTHON=/usr/bin/python fi