# HG changeset patch # User Marcin Kuzminski # Date 2018-03-01 15:46:49 # Node ID 9e96b80d3938bd3d6c3367914076385b381364ad # Parent 95f21d331145b62f7ad092256f42db6432ca3e76 cli: skip auth plugin search/registry in case of cli invocation for faster execution of those actions. - we don't need to load plugins for CLI calls diff --git a/rhodecode/authentication/__init__.py b/rhodecode/authentication/__init__.py --- a/rhodecode/authentication/__init__.py +++ b/rhodecode/authentication/__init__.py @@ -18,6 +18,7 @@ # RhodeCode Enterprise Edition, including its added features, Support services, # and proprietary license terms, please see https://rhodecode.com/licenses/ +import os import logging import importlib @@ -120,6 +121,11 @@ def includeme(config): route_name='auth_home', context=AuthnRootResource) + for key in ['RC_CMD_SETUP_RC', 'RC_CMD_UPGRADE_DB', 'RC_CMD_SSH_WRAPPER']: + if os.environ.get(key): + # skip this heavy step below on certain CLI commands + return + # Auto discover authentication plugins and include their configuration. _discover_plugins(config) _discover_legacy_plugins(config)