From 9e22f65ea26adbe4286f949335e2d9bead8452c3 Mon Sep 17 00:00:00 2001 From: Goutham Pacha Ravi Date: Wed, 26 May 2021 10:33:02 -0700 Subject: [PATCH] Fix site-packages in horizon's extend_start.sh We were relying on an unset variable from kolla: KOLLA_DISTRO_PYTHON_VERSION to figure out the location of site-packages to bootstrap horizon and load its various plugins. Since we only support python3, we can drop the need for a config variable, and rely on facts from the system to find our way. Change-Id: I428723525a334f7bf2235d8e6ae62da6d5d00bb7 Closes-Bug: BZ#1928291 Signed-off-by: Goutham Pacha Ravi (cherry picked from commit 6c8fbd330b5e8680fede0d63f4ef77bff5a15883) (cherry picked from commit b81b1ea1466176e38c9e2582aa3e4acaeeb874d4) (cherry picked from commit 14b7d3e78af1fa5e35c2a2bdf1af5ee0055a089e) --- container-images/kolla/horizon/extend_start.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/container-images/kolla/horizon/extend_start.sh b/container-images/kolla/horizon/extend_start.sh index 67fddeefb..5f66dc1a9 100644 --- a/container-images/kolla/horizon/extend_start.sh +++ b/container-images/kolla/horizon/extend_start.sh @@ -5,7 +5,8 @@ set -o errexit FORCE_GENERATE="${FORCE_GENERATE}" HASH_PATH=/var/lib/kolla/.settings.md5sum.txt MANAGE_PY="/usr/bin/python3 /usr/bin/manage.py" -SITE_PACKAGES="/usr/lib/python${KOLLA_DISTRO_PYTHON_VERSION:-3}/site-packages" +PYTHON_VERSION=$(python3 --version | awk '{print $2}' | awk -F'.' '{print $1"."$2}') +SITE_PACKAGES="/usr/lib/python${PYTHON_VERSION}/site-packages" if [[ -f /etc/openstack-dashboard/custom_local_settings ]]; then CUSTOM_SETTINGS_FILE="${SITE_PACKAGES}/openstack_dashboard/local/custom_local_settings.py"