Merge "WSGI: Move the application creation within the app method"

This commit is contained in:
Zuul 2018-06-01 21:11:37 +00:00 committed by Gerrit Code Review
commit cde17327a7
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,6 @@ from ara.webapp import create_app # flake8: noqa
from flask import current_app # flake8: noqa
log = logging.getLogger(__name__)
app = create_app()
def application(environ, start_response):
@ -60,6 +59,7 @@ def application(environ, start_response):
if 'ANSIBLE_CONFIG' not in os.environ:
log.warn('ANSIBLE_CONFIG environment variable not found.')
app = create_app()
if not current_app:
ctx = app.app_context()
ctx.push()