]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
bootstrap: Rebuild wrong-python venvs
authorZack Cerza <zack@redhat.com>
Fri, 2 Dec 2022 20:36:33 +0000 (13:36 -0700)
committerZack Cerza <zack@redhat.com>
Fri, 2 Dec 2022 20:49:52 +0000 (13:49 -0700)
Signed-off-by: Zack Cerza <zack@redhat.com>
bootstrap

index 53266cba3be2b86948e66a119cee0ac547e15d81..060301d3802896d6a70d09cded6a4e7dab922ea0 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -17,6 +17,7 @@ if [[ "$PYTHON" =~ "python2" ]]; then
 fi
 
 PYTHON=${PYTHON:-"python3"}
+PYTHON_VER_OUT=$($PYTHON --version)
 PYTHON_BIN=$(command -v $PYTHON)
 if [ -z $PYTHON_BIN -o ! -e $PYTHON_BIN -o ! -x $PYTHON_BIN ]; then
   echo "Cannot find $PYTHON!"
@@ -167,7 +168,10 @@ fi
 
 export LC_ALL=en_US.UTF-8
 
-if [ -z "$NO_CLOBBER" ] && [ ! -e "./$VENV/bin/pip" ]; then
+if [ -z "$NO_CLOBBER" ] && \
+  [ ! -e "./$VENV/bin/pip" -o ! -e "./$VENV/bin/$PYTHON" ] || \
+  [ "${PYTHON_VER_OUT}" != "$(./$VENV/bin/$PYTHON --version)" ] \
+  ; then
     rm -rf virtualenv
 fi