Merge "Add wsgi module"

This commit is contained in:
Zuul 2025-03-28 09:45:06 +00:00 committed by Gerrit Code Review
commit d8d4d94383
4 changed files with 27 additions and 1 deletions

View File

@ -19,5 +19,9 @@
See http://pecan.readthedocs.org/en/latest/deployment.html for details.
"""
from aodh.api import app
import warnings
warnings.warn('Using app.wsgi is deprecated. Use aodh.wsgi.api instead')
application = app.build_wsgi_app(argv=[])

0
aodh/wsgi/__init__.py Normal file
View File

22
aodh/wsgi/api.py Normal file
View File

@ -0,0 +1,22 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""WSGI application entry-point for Aodh API."""
import threading
from aodh.api import app
application = None
with threading.Lock():
if application is None:
application = app.build_wsgi_app(argv=[])

View File

@ -11,7 +11,7 @@ AODH_DIR=$DEST/aodh
AODH_CONF_DIR=/etc/aodh
AODH_CONF=$AODH_CONF_DIR/aodh.conf
AODH_UWSGI_CONF=$AODH_CONF_DIR/aodh-uwsgi.ini
AODH_UWSGI=$AODH_DIR/aodh/api/app.wsgi
AODH_UWSGI=aodh.wsgi.api:application
# Set up database backend
AODH_BACKEND=${AODH_BACKEND:-mysql}