From 1cda1acc7fd22bc42917c723f14c6ee076098297 Mon Sep 17 00:00:00 2001 From: Michal Arbet Date: Wed, 21 Aug 2024 14:08:34 +0200 Subject: Switch to Dynamic Python Version Detection This commit removes the hardcoded KOLLA_DISTRO_PYTHON_VERSION and replaces it with dynamic Python version detection during container images build. Dockerfiles and scripts now use general python3 references, simplifying maintenance and ensuring compatibility with future Python versions. Test cases relying on distro_python_version were also cleaned up. Change-Id: I891749598247a5e951ed4a873b16acfd0566f59c --- docker/openstack-base/Dockerfile.j2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'docker/openstack-base') diff --git a/docker/openstack-base/Dockerfile.j2 b/docker/openstack-base/Dockerfile.j2 index 1df4321e5..f6aebd6ca 100644 --- a/docker/openstack-base/Dockerfile.j2 +++ b/docker/openstack-base/Dockerfile.j2 @@ -195,7 +195,9 @@ RUN ln -s openstack-base-source/* /requirements \ #} && {{ macros.upper_constraints_remove("ovs") }} \ && mkdir -p /var/lib/kolla \ - && python3 -m venv --system-site-packages /var/lib/kolla/venv + && python3 -m venv --system-site-packages /var/lib/kolla/venv \ + && KOLLA_DISTRO_PYTHON_VERSION=$(/usr/bin/python3 -c "import sys; print('{}.{}'.format(sys.version_info.major, sys.version_info.minor))") \ + && ln -s python${KOLLA_DISTRO_PYTHON_VERSION} /var/lib/kolla/venv/lib/python3 {# Block used for overriding global version constraints. -- cgit v1.2.3