From: Zack Cerza Date: Mon, 1 Jul 2024 19:38:26 +0000 (-0600) Subject: bootstrap: Fix ansible version check X-Git-Tag: 1.2.0~27^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1964%2Fhead;p=teuthology.git bootstrap: Fix ansible version check Signed-off-by: Zack Cerza --- diff --git a/bootstrap b/bootstrap index c9dd835ef..30d3d4f2e 100755 --- 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