diff --git a/kallithea/config/middleware.py b/kallithea/config/middleware.py --- a/kallithea/config/middleware.py +++ b/kallithea/config/middleware.py @@ -23,6 +23,9 @@ __all__ = ['make_app'] # make_base_app will wrap the TurboGears2 app with all the middleware it needs. make_base_app = base_config.setup_tg_wsgi_app(load_environment) +def make_app_without_logging(global_conf, full_stack=True, **app_conf): + """The core of make_app for use from gearbox commands (other than 'serve')""" + return make_base_app(global_conf, full_stack=full_stack, **app_conf) def make_app(global_conf, full_stack=True, **app_conf): """ @@ -43,5 +46,4 @@ def make_app(global_conf, full_stack=Tru under ``[app:main]``. """ logging.config.fileConfig(global_conf['__file__']) - app = make_base_app(global_conf, full_stack=full_stack, **app_conf) - return app + return make_app_without_logging(global_conf, full_stack=full_stack, **app_conf) diff --git a/kallithea/lib/paster_commands/common.py b/kallithea/lib/paster_commands/common.py --- a/kallithea/lib/paster_commands/common.py +++ b/kallithea/lib/paster_commands/common.py @@ -71,7 +71,7 @@ class BasePasterCommand(gearbox.command. path_to_ini_file = os.path.realpath(args.config_file) conf = paste.deploy.appconfig('config:' + path_to_ini_file) logging.config.fileConfig(path_to_ini_file) - kallithea.config.middleware.make_app(conf.global_conf, **conf.local_conf) + kallithea.config.middleware.make_app_without_logging(conf.global_conf, **conf.local_conf) if self.requires_db_session: kallithea.lib.utils.setup_cache_regions(config)