From d29efdf1a6a0cca53cd34114b9eb3e8f7bc39a6e Mon Sep 17 00:00:00 2001 From: "wu.chunyang" Date: Thu, 17 Aug 2023 15:12:29 +0800 Subject: [PATCH] [CI]: fix trove api started failed this may be caused by: https://review.opendev.org/c/openstack/devstack/+/558930 Change-Id: I7af019fc3c4ce295e4e4b4ccafae5a170a7b7833 --- devstack/files/apache-trove-api.template | 2 ++ devstack/plugin.sh | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/devstack/files/apache-trove-api.template b/devstack/files/apache-trove-api.template index 767f18cffe..d82b3cd759 100644 --- a/devstack/files/apache-trove-api.template +++ b/devstack/files/apache-trove-api.template @@ -43,3 +43,5 @@ Listen %TROVE_SERVICE_PORT% + +%WSGIPYTHONHOME% diff --git a/devstack/plugin.sh b/devstack/plugin.sh index d7fac7a4fd..113ceea235 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -172,12 +172,17 @@ function config_trove_apache_wsgi { sudo cp $TROVE_DIR/trove/cmd/app_wsgi.py $TROVE_WSGI_DIR/app_wsgi.py trove_apache_conf=$(apache_site_config_for trove-api) sudo cp $TROVE_DEVSTACK_FILES/apache-trove-api.template ${trove_apache_conf} + local wsgi_venv_config="" + if [[ "$GLOBAL_VENV" == "True" ]] ; then + wsgi_venv_config="WSGIPythonHome $DEVSTACK_VENV" + fi sudo sed -e " s|%TROVE_SERVICE_PORT%|${TROVE_SERVICE_PORT}|g; s|%TROVE_WSGI_DIR%|${TROVE_WSGI_DIR}|g; s|%USER%|${STACK_USER}|g; s|%APACHE_NAME%|${APACHE_NAME}|g; s|%APIWORKERS%|${API_WORKERS}|g; + s|%WSGIPYTHONHOME%|${wsgi_venv_config}|g; " -i ${trove_apache_conf} enable_apache_site trove-api }