mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-05-16 13:56:11 +08:00
simplify things
This commit is contained in:
@@ -29,11 +29,8 @@ from os import sys
|
|||||||
|
|
||||||
from module_build_service import logger
|
from module_build_service import logger
|
||||||
|
|
||||||
imp.load_source('mbs_runtime_config', '/etc/module-build-service/config.py')
|
mbs_runtime_config = imp.load_source('mbs_runtime_config',
|
||||||
|
'/etc/module-build-service/config.py')
|
||||||
DevConfiguration = mbs_runtime_config.DevConfiguration
|
|
||||||
TestConfiguration = mbs_runtime_config.TestConfiguration
|
|
||||||
ProdConfiguration = mbs_runtime_config.ProdConfiguration
|
|
||||||
|
|
||||||
|
|
||||||
def init_config(app):
|
def init_config(app):
|
||||||
@@ -47,11 +44,11 @@ def _init_app_config(app):
|
|||||||
app.config.from_envvar("MBS_SETTINGS", silent=True)
|
app.config.from_envvar("MBS_SETTINGS", silent=True)
|
||||||
here = sys.path[0]
|
here = sys.path[0]
|
||||||
if any(['nosetests' in arg for arg in sys.argv]):
|
if any(['nosetests' in arg for arg in sys.argv]):
|
||||||
app.config.from_object('TestConfiguration')
|
app.config.from_object('mbs_runtime_config.TestConfiguration')
|
||||||
elif here not in ('/usr/bin', '/bin', '/usr/local/bin'):
|
elif here not in ('/usr/bin', '/bin', '/usr/local/bin'):
|
||||||
app.config.from_object('DevConfiguration')
|
app.config.from_object('mbs_runtime_config.DevConfiguration')
|
||||||
else:
|
else:
|
||||||
app.config.from_object('ProdConfiguration')
|
app.config.from_object('mbs_runtime_config.ProdConfiguration')
|
||||||
|
|
||||||
|
|
||||||
class Config(object):
|
class Config(object):
|
||||||
|
|||||||
Reference in New Issue
Block a user