Changeset - 2b07e757a85f
[Not reviewed]
default
0 1 0
Mads Kiilerich - 7 years ago 2018-08-08 02:23:11
mads@kiilerich.com
hooks: simplify app config code in _hook_environment - don't use relative_to
1 file changed with 4 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/hooks.py
Show inline comments
 
@@ -377,15 +377,16 @@ def _hook_environment(repo_path):
 
    from paste.deploy import appconfig
 
    from sqlalchemy import engine_from_config
 
    from kallithea.config.environment import load_environment
 
    from kallithea.model.base import init_model
 

	
 
    extras = _extract_extras()
 
    path, ini_name = os.path.split(extras['config'])
 
    conf = appconfig('config:%s' % ini_name, relative_to=path)
 
    conf = load_environment(conf.global_conf, conf.local_conf)
 
    ini_file_path = extras['config']
 
    #logging.config.fileConfig(ini_file_path) # Note: we are in a different process - don't use configured logging
 
    app_conf = appconfig('config:%s' % ini_file_path)
 
    conf = load_environment(app_conf.global_conf, app_conf.local_conf)
 

	
 
    setup_cache_regions(conf)
 

	
 
    engine = engine_from_config(conf, 'sqlalchemy.')
 
    init_model(engine)
 

	
0 comments (0 inline, 0 general)