diff --git a/aodh/api/app.wsgi b/aodh/api/app.wsgi index fb8eb6030..93641b215 100644 --- a/aodh/api/app.wsgi +++ b/aodh/api/app.wsgi @@ -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=[]) diff --git a/aodh/wsgi/__init__.py b/aodh/wsgi/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/aodh/wsgi/api.py b/aodh/wsgi/api.py new file mode 100644 index 000000000..ac6f8ddd3 --- /dev/null +++ b/aodh/wsgi/api.py @@ -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=[]) diff --git a/devstack/settings b/devstack/settings index 3cc49e5a1..d6fa91c5b 100644 --- a/devstack/settings +++ b/devstack/settings @@ -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}