fix2: '/usr/bin/python' is not existed in some OS

pull/1166/head
jin.gjm 2022-06-08 20:52:55 +08:00
parent f1b9b86071
commit 77c5e58a53
1 changed files with 3 additions and 3 deletions

6
ezctl
View File

@ -318,7 +318,7 @@ function add-node() {
sed -n '/^\[kube_master/,/^\[harbor/p' "$BASE/clusters/$1/hosts"|grep -E "^$2$|^$2 " && { logger error "node $2 already existed in $BASE/clusters/$1/hosts"; return 2; }
# add '/usr/bin/python' soft link, needed in some OS (ubuntu 16.04+)
[[ ! -e /usr/bin/python && -e /usr/bin/python3 ]] && ssh "$2" ln -s /usr/bin/python3 /usr/bin/python
ssh "$2" ln -s /usr/bin/python3 /usr/bin/python || echo ""
logger info "add $2 into 'kube_node' group"
NODE_INFO="${@:2}"
@ -336,7 +336,7 @@ function add-master() {
sed -n '/^\[kube_master/,/^\[kube_node/p' "$BASE/clusters/$1/hosts"|grep -E "^$2$|^$2 " && { logger error "master $2 already existed!"; return 2; }
# add '/usr/bin/python' soft link, needed in some OS (ubuntu 16.04+)
[[ ! -e /usr/bin/python && -e /usr/bin/python3 ]] && ssh "$2" ln -s /usr/bin/python3 /usr/bin/python
ssh "$2" ln -s /usr/bin/python3 /usr/bin/python || echo ""
logger info "add $2 into 'kube_master' group"
MASTER_INFO="${@:2}"
@ -360,7 +360,7 @@ function add-etcd() {
sed -n '/^\[etcd/,/^\[kube_master/p' "$BASE/clusters/$1/hosts"|grep -E "^$2$|^$2 " && { logger error "etcd $2 already existed!"; return 2; }
# add '/usr/bin/python' soft link, needed in some OS (ubuntu 16.04+)
[[ ! -e /usr/bin/python && -e /usr/bin/python3 ]] && ssh "$2" ln -s /usr/bin/python3 /usr/bin/python
ssh "$2" ln -s /usr/bin/python3 /usr/bin/python || echo ""
logger info "add $2 into 'etcd' group"
ETCD_INFO="${@:2}"