Browse Source

HPCC-25515 Fix conflict with python2 as default on system when python3 expected

Signed-off-by: Michael Gardner <michael.gardner@lexisnexisrisk.com>
Michael Gardner 4 years ago
parent
commit
07ffd09883

+ 2 - 2
initfiles/bash/etc/init.d/hpcc_common.in

@@ -898,12 +898,12 @@ is_user(){
 is_python_installed () {
    _expected_version=$1
 
-   which python > /dev/null 2>&1
+   which python3 > /dev/null 2>&1
    [ $? -ne 0 ] && return 1
 
    if [ -n "$_expected_version" ]
    then
-      _actual_version=$(python -V 2>&1 | cut -d' ' -f 2 | cut -d '.' -f -2)
+      _actual_version=$(python3 -V 2>&1 | cut -d' ' -f 2 | cut -d '.' -f -2)
       echo $_actual_version | grep -q -e "^[0-9]\.[0-9]$"
       [ $? -ne 0 ] && return 1
 

+ 1 - 1
initfiles/sbin/cluster_script.py

@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 '''
 /*#############################################################################
 

+ 1 - 1
initfiles/sbin/hpcc-push.sh.in

@@ -126,7 +126,7 @@ fi
 SCRIPT_FILE=~/hpcc-push_$$
 createScriptFile
 
-python_expected_version=2.6
+python_expected_version=3.4
 is_python_installed ${python_expected_version}
 if [ $? -eq 0 ]
 then

+ 1 - 1
initfiles/sbin/update-keys

@@ -143,7 +143,7 @@ fi
 SCRIPT_FILE=~/update-keys_$$
 createScriptFile
 
-python_expected_version=2.6
+python_expected_version=3.4
 is_python_installed ${python_expected_version}
 if [ $? -eq 0 ]
 then