diff --git a/conf/config.py b/conf/config.py index 32a5408b..bddd1dc4 100644 --- a/conf/config.py +++ b/conf/config.py @@ -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' diff --git a/module_build_service/config.py b/module_build_service/config.py index defb5a67..0568b459 100644 --- a/module_build_service/config.py +++ b/module_build_service/config.py @@ -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',