# HG changeset patch # User Johannes Bornhold # Date 2016-06-06 09:26:27 # Node ID 5edcb8e36c632a029560b494d82d5f340eff063d # Parent 1c4d75a036865434f0b089fbd2fa20ecbbcd532c authn: Make the legacy plugin import more robust if something fails during import. diff --git a/rhodecode/authentication/__init__.py b/rhodecode/authentication/__init__.py --- a/rhodecode/authentication/__init__.py +++ b/rhodecode/authentication/__init__.py @@ -72,13 +72,16 @@ def _discover_legacy_plugins(config, pre for plugin_id in legacy_plugins: module_name = plugin_id.split(prefix, 1)[-1] try: - log.debug('Import %s', module_name) module = importlib.import_module(module_name) plugin = module.plugin_factory(plugin_id=plugin_id) config.include(plugin.includeme) except ImportError as e: log.error( - 'Error while importing legacy authentication plugin ' + 'ImportError while importing legacy authentication plugin ' + '"{}": {}'.format(plugin_id, e.message)) + except Exception as e: + log.error( + 'Exception while importing legacy authentication plugin ' '"{}": {}'.format(plugin_id, e.message))