summaryrefslogtreecommitdiff
path: root/bootstrap/run_salt.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap/run_salt.sh')
-rwxr-xr-xbootstrap/run_salt.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/bootstrap/run_salt.sh b/bootstrap/run_salt.sh
index 59fd402..3977e9c 100755
--- a/bootstrap/run_salt.sh
+++ b/bootstrap/run_salt.sh
@@ -3,13 +3,27 @@
working_dir="${1}"
build_basedir="${2}"
local_build="${3}"
-python=$(which python3 || false)
salt_running_p() {
ps -ef | grep -F "salt-call" | grep -v "grep"
return ${?}
}
+python3_supported=$(python <<EOF
+try:
+ from salt.scripts import salt_call
+ print("success")
+except ImportError:
+ print("fail")
+EOF
+)
+
+if [ "${python3_supported}" == "success" ]; then
+ python=$(which python)
+else
+ python=$(which python2)
+fi
+
while salt_running_p; do
sleep 5
done