From 1d2856a416761b4a02245104a60f0c258c823ffd Mon Sep 17 00:00:00 2001 From: Sean Mooney Date: Thu, 24 Oct 2024 02:47:43 +0100 Subject: [PATCH] [devstack] use $PYTHON when configuring horizon Devstack gained the ablity to install all services in a shared venv and became the default way to install on all debian derived distor as part of If9bc7ba45522189d03f19b86cb681bb150ee2f25 Today the plugin uses the system python3 executable to invoke the manage.py untility to collect the static resouces and compress them. This change updates the devtack plugin to support installation in the global venv. When horizon is installed in a global venv the manage command cannot import django or other depencies if invoked by system python directly. When installed in a global virutal environment, devstack exports PYTHON to use the virtual env executeable. ```export PYTHON="$DEVSTACK_VENV/bin/python3"``` when a gobal venv is not enabled it export PYTHON to use the correct system python ```export PYTHON=$(which python${PYTHON3_VERSION} 2>/dev/null)``` As such we can always rely on $PYTHON to contain the correct execuable. Closes-Bug: #2085487 Change-Id: I161db1e824ee2fafd305313a729795ed2ade634a --- devstack/plugin.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 3cb20d8..b1b3124 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -13,8 +13,8 @@ function configure_watcher_dashboard { function init_watcher_dashboard { # Setup alias for django-admin which could be different depending on distro - python3 ${DEST}/horizon/manage.py collectstatic --noinput - python3 ${DEST}/horizon/manage.py compress --force + $PYTHON ${DEST}/horizon/manage.py collectstatic --noinput + $PYTHON ${DEST}/horizon/manage.py compress --force } # check for service enabled