lib/placement: Remove support for deploying with mod_wsgi

Change-Id: If17deabc35d35dca1d94b0d15d258769f347b130
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2024-10-11 15:38:42 +01:00
parent 7e8d5efdf2
commit e1465f1d73
2 changed files with 3 additions and 71 deletions

View File

@ -1,27 +0,0 @@
# NOTE(sbauza): This virtualhost is only here because some directives can
# only be set by a virtualhost or server context, so that's why the port is not bound.
# TODO(sbauza): Find a better way to identify a free port that is not corresponding to an existing
# vhost.
<VirtualHost *:8780>
WSGIDaemonProcess placement-api processes=%APIWORKERS% threads=1 user=%USER% display-name=%{GROUP} %VIRTUALENV%
WSGIProcessGroup placement-api
WSGIScriptAlias / %PUBLICWSGI%
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
<IfVersion >= 2.4>
ErrorLogFormat "%M"
</IfVersion>
ErrorLog /var/log/%APACHE_NAME%/placement-api.log
%SSLENGINE%
%SSLCERTFILE%
%SSLKEYFILE%
</VirtualHost>
Alias /placement %PUBLICWSGI%
<Location /placement>
SetHandler wsgi-script
Options +ExecCGI
WSGIProcessGroup placement-api
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
</Location>

View File

@ -71,32 +71,6 @@ function cleanup_placement {
remove_uwsgi_config "$PLACEMENT_UWSGI_CONF" "placement-api" remove_uwsgi_config "$PLACEMENT_UWSGI_CONF" "placement-api"
} }
# _config_placement_apache_wsgi() - Set WSGI config files
function _config_placement_apache_wsgi {
local placement_api_apache_conf
local venv_path=""
local placement_bin_dir=""
placement_bin_dir=$(get_python_exec_prefix)
placement_api_apache_conf=$(apache_site_config_for placement-api)
if [[ ${USE_VENV} = True ]]; then
venv_path="python-path=${PROJECT_VENV["placement"]}/lib/$(python_version)/site-packages"
placement_bin_dir=${PROJECT_VENV["placement"]}/bin
fi
sudo cp $FILES/apache-placement-api.template $placement_api_apache_conf
sudo sed -e "
s|%APACHE_NAME%|$APACHE_NAME|g;
s|%PUBLICWSGI%|$placement_bin_dir/placement-api|g;
s|%SSLENGINE%|$placement_ssl|g;
s|%SSLCERTFILE%|$placement_certfile|g;
s|%SSLKEYFILE%|$placement_keyfile|g;
s|%USER%|$STACK_USER|g;
s|%VIRTUALENV%|$venv_path|g
s|%APIWORKERS%|$API_WORKERS|g
" -i $placement_api_apache_conf
}
# create_placement_conf() - Write config # create_placement_conf() - Write config
function create_placement_conf { function create_placement_conf {
rm -f $PLACEMENT_CONF rm -f $PLACEMENT_CONF
@ -112,11 +86,7 @@ function configure_placement {
sudo install -d -o $STACK_USER $PLACEMENT_CONF_DIR sudo install -d -o $STACK_USER $PLACEMENT_CONF_DIR
create_placement_conf create_placement_conf
if [[ "$WSGI_MODE" == "uwsgi" ]]; then
write_uwsgi_config "$PLACEMENT_UWSGI_CONF" "$PLACEMENT_UWSGI" "/placement" write_uwsgi_config "$PLACEMENT_UWSGI_CONF" "$PLACEMENT_UWSGI" "/placement"
else
_config_placement_apache_wsgi
fi
if [[ "$PLACEMENT_ENFORCE_SCOPE" == "True" || "$ENFORCE_SCOPE" == "True" ]]; then if [[ "$PLACEMENT_ENFORCE_SCOPE" == "True" || "$ENFORCE_SCOPE" == "True" ]]; then
iniset $PLACEMENT_CONF oslo_policy enforce_new_defaults True iniset $PLACEMENT_CONF oslo_policy enforce_new_defaults True
iniset $PLACEMENT_CONF oslo_policy enforce_scope True iniset $PLACEMENT_CONF oslo_policy enforce_scope True
@ -147,7 +117,6 @@ function init_placement {
# install_placement() - Collect source and prepare # install_placement() - Collect source and prepare
function install_placement { function install_placement {
install_apache_wsgi
# Install the openstackclient placement client plugin for CLI # Install the openstackclient placement client plugin for CLI
pip_install_gr osc-placement pip_install_gr osc-placement
git_clone $PLACEMENT_REPO $PLACEMENT_DIR $PLACEMENT_BRANCH git_clone $PLACEMENT_REPO $PLACEMENT_DIR $PLACEMENT_BRANCH
@ -156,12 +125,7 @@ function install_placement {
# start_placement_api() - Start the API processes ahead of other things # start_placement_api() - Start the API processes ahead of other things
function start_placement_api { function start_placement_api {
if [[ "$WSGI_MODE" == "uwsgi" ]]; then
run_process "placement-api" "$(which uwsgi) --procname-prefix placement --ini $PLACEMENT_UWSGI_CONF" run_process "placement-api" "$(which uwsgi) --procname-prefix placement --ini $PLACEMENT_UWSGI_CONF"
else
enable_apache_site placement-api
restart_apache_server
fi
echo "Waiting for placement-api to start..." echo "Waiting for placement-api to start..."
if ! wait_for_service $SERVICE_TIMEOUT $PLACEMENT_SERVICE_PROTOCOL://$PLACEMENT_SERVICE_HOST/placement; then if ! wait_for_service $SERVICE_TIMEOUT $PLACEMENT_SERVICE_PROTOCOL://$PLACEMENT_SERVICE_HOST/placement; then
@ -175,12 +139,7 @@ function start_placement {
# stop_placement() - Disable the api service and stop it. # stop_placement() - Disable the api service and stop it.
function stop_placement { function stop_placement {
if [[ "$WSGI_MODE" == "uwsgi" ]]; then
stop_process "placement-api" stop_process "placement-api"
else
disable_apache_site placement-api
restart_apache_server
fi
} }
# Restore xtrace # Restore xtrace