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:
parent
a6ca0b69f0
commit
9c6a865f4b
10
ara/wsgi.py
10
ara/wsgi.py
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue