implement MODULE_BUILD_SERVICE_DEVELOPER_ENV functionality

This commit is contained in:
Filip Valder
2016-12-09 13:30:57 +01:00
parent eec8bd542f
commit 2eda23233e
2 changed files with 9 additions and 1 deletions

View File

@@ -22,8 +22,10 @@
# SOFTWARE.
#
# Written by Petr Šabata <contyk@redhat.com>
# Filip Valder <fvalder@redhat.com>
import imp
import os
from os import sys
@@ -49,6 +51,9 @@ def _init_app_config(app):
here = sys.path[0]
if any(['nosetests' in arg for arg in sys.argv]):
app.config.from_object('%s.TestConfiguration' % conf_module)
elif 'MODULE_BUILD_SERVICE_DEVELOPER_ENV' in os.environ and \
os.environ['MODULE_BUILD_SERVICE_DEVELOPER_ENV']:
app.config.from_object('%s.DevConfiguration' % conf_module)
elif here not in ('/usr/bin', '/bin', '/usr/local/bin'):
app.config.from_object('%s.DevConfiguration' % conf_module)
else:

View File

@@ -291,8 +291,11 @@ def generatelocalhostcert():
def runssl(host=conf.host, port=conf.port, debug=False):
""" Runs the Flask app with the HTTPS settings configured in config.py
"""
logging.info('Starting Rida')
logging.info('Starting Module Build Service frontend')
ssl_ctx = _establish_ssl_context()
if 'MODULE_BUILD_SERVICE_DEVELOPER_ENV' in os.environ and \
os.environ['MODULE_BUILD_SERVICE_DEVELOPER_ENV']:
debug = True
app.run(
host=host,
port=port,