Use module path to load wsgi application
devstack is now replacing usage of wsgi script by wsgi module. This replaces the way to load the api wsgi app following that transition. Change-Id: Id799bacb71483d2e337c049e1db7f85735eb5a1e
This commit is contained in:
parent
347d3a8fef
commit
ecf76ae7d7
@ -7,7 +7,7 @@ ZAQAR_CONF_DIR=/etc/zaqar
|
|||||||
ZAQAR_CONF=$ZAQAR_CONF_DIR/zaqar.conf
|
ZAQAR_CONF=$ZAQAR_CONF_DIR/zaqar.conf
|
||||||
ZAQAR_POLICY_CONF=$ZAQAR_CONF_DIR/policy.yaml
|
ZAQAR_POLICY_CONF=$ZAQAR_CONF_DIR/policy.yaml
|
||||||
ZAQAR_UWSGI_CONF=$ZAQAR_CONF_DIR/uwsgi.conf
|
ZAQAR_UWSGI_CONF=$ZAQAR_CONF_DIR/uwsgi.conf
|
||||||
ZAQAR_UWSGI=$ZAQAR_DIR/zaqar/transport/wsgi/app.py
|
ZAQAR_UWSGI=zaqar.transport.wsgi.app:application
|
||||||
ZAQAR_API_LOG_DIR=/var/log/zaqar
|
ZAQAR_API_LOG_DIR=/var/log/zaqar
|
||||||
ZAQAR_API_LOG_FILE=$ZAQAR_API_LOG_DIR/queues.log
|
ZAQAR_API_LOG_FILE=$ZAQAR_API_LOG_DIR/queues.log
|
||||||
ZAQAR_AUTH_CACHE_DIR=${ZAQAR_AUTH_CACHE_DIR:-/var/cache/zaqar}
|
ZAQAR_AUTH_CACHE_DIR=${ZAQAR_AUTH_CACHE_DIR:-/var/cache/zaqar}
|
||||||
|
@ -26,6 +26,8 @@ no common way to specify / pass configuration files
|
|||||||
to the WSGI app when it is called from other apps.
|
to the WSGI app when it is called from other apps.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import threading
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
from oslo_reports import guru_meditation_report as gmr
|
from oslo_reports import guru_meditation_report as gmr
|
||||||
@ -35,16 +37,27 @@ from zaqar import bootstrap
|
|||||||
from zaqar import version
|
from zaqar import version
|
||||||
|
|
||||||
# Use the global CONF instance
|
# Use the global CONF instance
|
||||||
conf = cfg.CONF
|
CONF = cfg.CONF
|
||||||
gmr_opts.set_defaults(conf)
|
|
||||||
log.register_options(conf)
|
|
||||||
conf(project='zaqar', prog='zaqar-queues', args=[])
|
|
||||||
log.setup(conf, 'zaqar')
|
|
||||||
|
|
||||||
gmr.TextGuruMeditation.setup_autorun(version, conf=conf)
|
|
||||||
|
|
||||||
boot = bootstrap.Bootstrap(conf)
|
def init_application():
|
||||||
conf.drivers.transport = 'wsgi'
|
gmr_opts.set_defaults(CONF)
|
||||||
application = boot.transport.app
|
log.register_options(CONF)
|
||||||
# Keep the old name for compatibility
|
CONF(project='zaqar', prog='zaqar-queues', args=[])
|
||||||
app = application
|
log.setup(CONF, 'zaqar')
|
||||||
|
|
||||||
|
gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
|
||||||
|
|
||||||
|
boot = bootstrap.Bootstrap(CONF)
|
||||||
|
CONF.drivers.transport = 'wsgi'
|
||||||
|
return boot.transport.app
|
||||||
|
|
||||||
|
|
||||||
|
app = application = None
|
||||||
|
|
||||||
|
lock = threading.Lock()
|
||||||
|
with lock:
|
||||||
|
if application is None:
|
||||||
|
application = init_application()
|
||||||
|
# Keep the old name for compatibility
|
||||||
|
app = application
|
||||||
|
Loading…
x
Reference in New Issue
Block a user