From 39bd971a869ee3c6ba59024a6288048699840714 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Mon, 1 Jul 2024 13:38:26 -0600 Subject: [PATCH] bootstrap: Fix ansible version check Signed-off-by: Zack Cerza --- bootstrap | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bootstrap b/bootstrap index c9dd835efd..30d3d4f2ef 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 -- 2.39.5