Skip to content

Commit 76f82ac

Browse files
committed
Use python version to set DEFAULT_PIP_ANSIBLE
Instead of assuming the python version based on the distro, we check the python version. (Check borrowed from bifrost-cli) This patch defaults to the newer ansible version, and if python is old, we override it with the old ansible package. This lets us install on the RHELatives like Alma and Rocky, which the current check is preventing. Change-Id: I47413eab8c5132ab3201b4c7197ec15c17d18e12
1 parent 2d6ccc2 commit 76f82ac

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

scripts/env-setup.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ set -euo pipefail
55
. $(dirname $0)/install-deps.sh
66
# NOTE(pas-ha) the above exports some useful variables like
77
# $PYTHON , $PIP and $VENV depending on venv install or not
8-
source /etc/os-release
9-
if [[ $ID == "centos" ]] || [[ $VERSION_CODENAME == "bullseye" ]]; then
8+
9+
DEFAULT_PIP_ANSIBLE='>=9,<10'
10+
if ! python3 -c "import sys; assert sys.version_info >= (3, 10)" 2> /dev/null; then
1011
DEFAULT_PIP_ANSIBLE='>=8,<9'
11-
elif [[ $ID == "ubuntu" ]] || [[ $VERSION_CODENAME == "bookworm" ]] ; then
12-
DEFAULT_PIP_ANSIBLE='>=9,<10'
1312
fi
1413

1514
ANSIBLE_COLLECTIONS_REQ=${ANSIBLE_COLLECTIONS_REQ:-$(dirname $0)/../ansible-collections-requirements.yml}

0 commit comments

Comments
 (0)