Parcourir la source

AMBARI-12912. Python Wrapper Can Choose Two Different Python Versions (aonishuk)

Andrew Onishuk il y a 10 ans
Parent
commit
85c87bffae
1 fichiers modifiés avec 8 ajouts et 4 suppressions
  1. 8 4
      ambari-common/src/main/unix/ambari-python-wrap

+ 8 - 4
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