Allow ara to be run by other web services apart from Apache.

Added also a check whether a user set the variable ANSIBLE_CONFIG or not.

Change-Id: I55121aa157f021dbd349c4ece30f8533d2f81bb8
This commit is contained in:
trobiyo 2017-07-31 14:47:09 +02:00 committed by David Moreau Simard
parent a6ca0b69f0
commit 9c6a865f4b
1 changed files with 9 additions and 1 deletions

View File

@ -19,10 +19,18 @@
# ANSIBLE_CONFIG environment variable in order to configure Ansible and ARA.
import os
import logging
log = logging.getLogger(__name__)
def application(environ, start_response):
os.environ['ANSIBLE_CONFIG'] = environ['ANSIBLE_CONFIG']
if 'ANSIBLE_CONFIG' in environ:
os.environ['ANSIBLE_CONFIG'] = environ['ANSIBLE_CONFIG']
else:
if 'ANSIBLE_CONFIG' not in os.environ:
log.warn('ANSIBLE_CONFIG environment variable not found.')
from ara.webapp import create_app
app = create_app()
return app(environ, start_response)