Skip to content

Commit 575dae0

Browse files
committed
ci: Fix installing openstack cli on debian bookworm
1 parent e5da88f commit 575dae0

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

hack/ci/create_devstack.sh

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -77,32 +77,26 @@ function retry {
7777
function ensure_openstack_client {
7878
if ! command -v openstack;
7979
then
80-
# We are running in a Debian Buster image with python 3.7. Python 3.7
81-
# is starting to show its age in upstream support. Ideally we would
82-
# move to a newer image with a newer python version.
83-
#
84-
# Until then, this script tries to carefully navigate around current
85-
# issues running openstack client on python 3.7.
86-
#
87-
# We explicitly pin the yoga version of openstackclient. This is the
88-
# last version of openstackclient which will support python 3.7.
89-
9080
# Install virtualenv to install the openstack client and curl to fetch
9181
# the build constraints.
9282
apt-get install -y python3-virtualenv curl
9383
python3 -m virtualenv -p $(which python3) /tmp/openstack-venv
9484
VIRTUAL_ENV_DISABLE_PROMPT=1 source /tmp/openstack-venv/bin/activate
9585

96-
# openstackclient has never actually supported python 3.7, only 3.6 and
97-
# 3.8. Here we download the yoga constraints file and modify all the
98-
# 3.8 constraints to be 3.7 constraints.
99-
curl -L https://releases.openstack.org/constraints/upper/yoga -o /tmp/yoga-constraints
100-
sed -i "s/python_version=='3.8'/python_version=='3.7'/" /tmp/yoga-constraints
86+
# We explicitly pin to the stable branch version of openstackclient.
87+
curl -L https://releases.openstack.org/constraints/upper/${OPENSTACK_RELEASE} -o /tmp/openstack-constraints
88+
89+
# Hack for yoga only: wrapt <1.14 doesn't support python 3.11
90+
[ "${OPENSTACK_RELEASE}" == "yoga" ] || exit 1 # Delete this hack
91+
sed -i "s/^wrapt===1\.13.*/wrapt===1.14.1/" /tmp/openstack-constraints
10192

102-
pip install -c /tmp/yoga-constraints \
93+
pip install -c /tmp/openstack-constraints \
10394
python-openstackclient python-cinderclient \
10495
python-glanceclient python-keystoneclient \
10596
python-neutronclient python-novaclient python-octaviaclient
97+
98+
# Ensure openstack cli can load fully including all plugins
99+
openstack help >/dev/null
106100
fi
107101
}
108102

0 commit comments

Comments
 (0)