From e33902c30cb7e07d48621d3c574594b2084f1bdc Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Fri, 2 May 2025 20:11:38 +0200 Subject: [PATCH] bifrost: fix creation of python3 lib symlink MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When {{ venv_path }}/lib/python3 already exist and we run the ln command, we end up with: /var/lib/kolla/venv/lib/ ├── python3 -> python3.9 ├── python3.12 │   └── site-packages └── python3.9 ├── python3.12 -> python3.12 └── site-packages Instead, it should be: /var/lib/kolla/venv/lib/ ├── python3 -> python3.12 ├── python3.12 │   └── site-packages └── python3.9 └── site-packages Remove the existing link first to ensure it is created properly. Change-Id: I42dd2490d14070074fe1fa7ae9e0a4cbf095b06f --- docker/bifrost/bifrost-base/Dockerfile.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/bifrost/bifrost-base/Dockerfile.j2 b/docker/bifrost/bifrost-base/Dockerfile.j2 index 8106652c36..2596842c73 100644 --- a/docker/bifrost/bifrost-base/Dockerfile.j2 +++ b/docker/bifrost/bifrost-base/Dockerfile.j2 @@ -48,7 +48,8 @@ RUN mkdir -p /requirements \ && python3 -m venv --system-site-packages {{ venv_path }} \ && KOLLA_DISTRO_PYTHON_VERSION=$(/usr/bin/python3 -c "import sys; print('{}.{}'.format(sys.version_info.major, sys.version_info.minor))") \ && cd {{ venv_path }}/lib \ - && ln -s python${KOLLA_DISTRO_PYTHON_VERSION} {{ venv_path }}/lib/python3 + && rm -f python3 \ + && ln -s python${KOLLA_DISTRO_PYTHON_VERSION} python3 RUN ln -s bifrost-base-source/* bifrost \ && {{ macros.install_pip(['pip', 'wheel', 'setuptools']) }} \