register/set 'debug' conf variable

This commit is contained in:
Filip Valder
2016-12-09 17:29:41 +01:00
parent ee3472338c
commit 379af8fe7e
2 changed files with 9 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ dbdir = path.abspath(path.join(confdir, '..')) if confdir.endswith('conf') \
class BaseConfiguration(object):
DEBUG = False
# Make this random (used to generate session keys)
SECRET_KEY = '74d9e9f9cd40e66fc6c4c2e9987dce48df3ce98542529fd0'
SQLALCHEMY_DATABASE_URI = 'sqlite:///{0}'.format(path.join(
@@ -84,6 +85,7 @@ class BaseConfiguration(object):
class DevConfiguration(BaseConfiguration):
DEBUG = True
LOG_BACKEND = 'console'
LOG_LEVEL = 'debug'
@@ -124,6 +126,7 @@ class DevConfiguration(BaseConfiguration):
KOJI_CONFIG = path.join(confdir, 'koji.conf')
COPR_CONFIG = path.join(confdir, 'copr.conf')
class TestConfiguration(BaseConfiguration):
LOG_BACKEND = 'console'
LOG_LEVEL = 'debug'

View File

@@ -52,7 +52,8 @@ def _init_app_config(app):
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']:
os.environ['MODULE_BUILD_SERVICE_DEVELOPER_ENV'].lower() in (
'1', 'on', 'true', 'y', 'yes'):
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)
@@ -63,6 +64,10 @@ def _init_app_config(app):
class Config(object):
"""Class representing the orchestrator configuration."""
_defaults = {
'debug': {
'type': bool,
'default': False,
'desc': 'Debug mode'},
'system': {
'type': str,
'default': 'koji',