@@ -77,32 +77,26 @@ function retry {
77
77
function ensure_openstack_client {
78
78
if ! command -v openstack;
79
79
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
-
90
80
# Install virtualenv to install the openstack client and curl to fetch
91
81
# the build constraints.
92
82
apt-get install -y python3-virtualenv curl
93
83
python3 -m virtualenv -p $( which python3) /tmp/openstack-venv
94
84
VIRTUAL_ENV_DISABLE_PROMPT=1 source /tmp/openstack-venv/bin/activate
95
85
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
101
92
102
- pip install -c /tmp/yoga -constraints \
93
+ pip install -c /tmp/openstack -constraints \
103
94
python-openstackclient python-cinderclient \
104
95
python-glanceclient python-keystoneclient \
105
96
python-neutronclient python-novaclient python-octaviaclient
97
+
98
+ # Ensure openstack cli can load fully including all plugins
99
+ openstack help > /dev/null
106
100
fi
107
101
}
108
102
0 commit comments