Rename app.wsgi to app_wsgi.py

1. app.wsgi is a python script and should be end with py extension.
2. Generate trove-wsgi script which is needed by kolla to support
https and ipv6.
3. Ignore build directory in git
4. update docs

Change-Id: Ibbd6ecb8db25aa3a443d3f526f4cf6d418eb26f3
This commit is contained in:
wu.chunyang 2022-08-24 17:17:42 +08:00
parent 528741b449
commit 44c3cdef5c
8 changed files with 13 additions and 5 deletions

5
.gitignore vendored
View File

@ -30,6 +30,11 @@ trove.iml
# Files generated by Visual Studio Code
.vscode/
# Files generated by setup.py
*.egg-info
build
.eggs
# Sphinx
doc/build/*
doc/source/api/*

View File

@ -21,7 +21,7 @@ Listen %TROVE_SERVICE_PORT%
<VirtualHost *:%TROVE_SERVICE_PORT%>
WSGIDaemonProcess trove-api user=%USER% processes=%APIWORKERS% threads=1 display-name=%{GROUP}
WSGIScriptAlias / %TROVE_WSGI_DIR%/app.wsgi
WSGIScriptAlias / %TROVE_WSGI_DIR%/app_wsgi.py
WSGIApplicationGroup %{GLOBAL}
WSGIProcessGroup trove-api
WSGIPassAuthorization On

View File

@ -169,7 +169,7 @@ function config_trove_apache_wsgi {
local trove_apache_conf
sudo mkdir -p ${TROVE_WSGI_DIR}
sudo cp $TROVE_DIR/trove/cmd/app.wsgi $TROVE_WSGI_DIR/app.wsgi
sudo cp $TROVE_DIR/trove/cmd/app_wsgi.py $TROVE_WSGI_DIR/app.wsgi
trove_apache_conf=$(apache_site_config_for trove-api)
sudo cp $TROVE_DEVSTACK_FILES/apache-trove-api.template ${trove_apache_conf}
sudo sed -e "

View File

@ -36,7 +36,7 @@ Installing API behind mod_wsgi
* Modify the ``WSGIDaemonProcess`` directive to set the ``user`` and
``group`` values to appropriate user on your server.
* Modify the ``WSGIScriptAlias`` directive to point to the
trove/api/app.wsgi script.
trove/api/app_wsgi.py script.
* Modify the ``Directory`` directive to set the path to the Trove API
code.
* Modify the ``ErrorLog and CustomLog`` to redirect the logs to the right

View File

@ -19,7 +19,7 @@ Listen 8779
<VirtualHost *:8779>
WSGIDaemonProcess trove-api user=stack group=stack processes=2 threads=2 display-name=%{GROUP}
WSGIScriptAlias / /opt/stack/trove/trove/cmd/app.wsgi
WSGIScriptAlias / /opt/stack/trove/trove/cmd/app_wsgi.py
WSGIProcessGroup trove-api
ErrorLog /var/log/httpd/trove_error.log

View File

@ -26,6 +26,8 @@ packages =
trove
[entry_points]
wsgi_scripts =
trove-wsgi = trove.cmd.api_wsgi:wsgimain
console_scripts =
trove-api = trove.cmd.api:main
trove-taskmanager = trove.cmd.taskmanager:main

View File

@ -65,7 +65,7 @@ builtins = _
# add *.yaml for playbooks/trove-devstack-base.yaml, as it will be matched by
# trove-* in the "filename" configuration.
exclude=.venv,.tox,.git,dist,doc,*egg,tools,etc,build,*.po,*.pot,integration,releasenotes,*.yaml
filename=*.py,trove-*,app.wsgi
filename=*.py,trove-*
[hacking]
import_exceptions = trove.common.i18n

View File

@ -38,4 +38,5 @@ def wsgimain(CONF):
LOG.debug("Trove started on %s", CONF.host)
return pastedeploy.paste_deploy_app(conf_file, 'trove', {})
application = wsgimain()