]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
bootstrap: Fix ansible version check 1964/head
authorZack Cerza <zack@redhat.com>
Mon, 1 Jul 2024 19:38:26 +0000 (13:38 -0600)
committerZack Cerza <zack@redhat.com>
Mon, 1 Jul 2024 19:38:26 +0000 (13:38 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
bootstrap

index c9dd835efd780d54c0d8d0a0f1e7efeffeddf5b0..30d3d4f2ef1ca8727172a897586b59c5c0788321 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -207,8 +207,7 @@ fi
 # 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/ansible --version | head -n1 | sed -e 's/.*\([[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\).*/\1/')
-    uninstall_ansible=$(./$VENV/bin/python3 -c "from packaging.version import parse; print(parse('$ansible_version') < parse('2.10.0'))")
+    uninstall_ansible=$(./$VENV/bin/python3 -c "import ansible; 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