diff options
| author | Michal Arbet <michal.arbet@ultimum.io> | 2024-08-21 14:08:34 +0200 |
|---|---|---|
| committer | Michal Arbet <michal.arbet@ultimum.io> | 2024-09-19 12:22:16 +0200 |
| commit | 1cda1acc7fd22bc42917c723f14c6ee076098297 (patch) | |
| tree | f8d37bd7c857169ab6ffa38df81da45f60e1fcaa /docker/openstack-base | |
| parent | 015fd8d42a42a49243970c703fd513d3d5b2ce74 (diff) | |
| download | kolla-1cda1acc7fd22bc42917c723f14c6ee076098297.tar.gz kolla-1cda1acc7fd22bc42917c723f14c6ee076098297.zip | |
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
Diffstat (limited to 'docker/openstack-base')
| -rw-r--r-- | docker/openstack-base/Dockerfile.j2 | 4 |
1 files changed, 3 insertions, 1 deletions
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. |
