]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Default to python 3.8
authorZack Cerza <zack@redhat.com>
Wed, 7 Dec 2022 23:03:53 +0000 (16:03 -0700)
committerZack Cerza <zack@redhat.com>
Wed, 7 Dec 2022 23:41:17 +0000 (16:41 -0700)
Signed-off-by: Zack Cerza <zack@redhat.com>
bootstrap

index 060301d3802896d6a70d09cded6a4e7dab922ea0..385c05768c1548b942fcc9372292f48b48316ac2 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -16,7 +16,16 @@ if [[ "$PYTHON" =~ "python2" ]]; then
     exit 1
 fi
 
-PYTHON=${PYTHON:-"python3"}
+# This dance is to keep us from using 3.6, even on systems where it is the OS's
+# preferred version. Can be dropped when no teuthology lab in production requires
+# an older version.
+if [ -z "$PYTHON" ]; then
+  for i in 10 9 8 7; do
+    command -v "python3.$i" && PYTHON="python3.$i" && break
+  done
+  # This would be bizarre, but I suppose possible
+  PYTHON=${PYTHON:-"python3"}
+fi
 PYTHON_VER_OUT=$($PYTHON --version)
 PYTHON_BIN=$(command -v $PYTHON)
 if [ -z $PYTHON_BIN -o ! -e $PYTHON_BIN -o ! -x $PYTHON_BIN ]; then