Signed-off-by: Zack Cerza <zack@redhat.com>
# 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