]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
bootstrap: Do ansible version check inside venv 1754/head
authorZack Cerza <zack@cerza.org>
Thu, 28 Apr 2022 19:28:33 +0000 (13:28 -0600)
committerZack Cerza <zack@cerza.org>
Thu, 28 Apr 2022 22:54:15 +0000 (16:54 -0600)
We need access to the packaging module to do so.

Signed-off-by: Zack Cerza <zack@redhat.com>
bootstrap

index 997882df4bd2aa870e8371fb96db5cba1d0e2101..5aa9fd834acc8a85712c1dd43418411efafe578d 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -150,11 +150,13 @@ if [ -z "$NO_CLOBBER" ] || [ ! -e ./$VENV ]; then
     virtualenv --python=$PYTHON $VENV
 fi
 
+./$VENV/bin/pip install packaging
+
 # It is impossible to upgrade ansible from 2.9 to 2.10 via pip.
 # See https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_2.10.html#known-issues
 if [ -f "$VENV/bin/ansible" ]; then
     ansible_version=$($VENV/bin/pip list --format json | python3 -c "import sys; import json; print(list(filter(lambda i: i['name'] == 'ansible', json.loads(sys.stdin.read())))[0]['version'])")
-    uninstall_ansible=$(python3 -c "from packaging.version import parse; print(parse('$ansible_version') < parse('2.10.0'))")
+    uninstall_ansible=$(./$VENV/bin/python3 -c "from packaging.version import parse; print(parse('$ansible_version') < parse('2.10.0'))")
     if [ "$uninstall_ansible" = "True" ]; then
         ./$VENV/bin/pip uninstall -y ansible
     fi