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
This commit is contained in:
Marcin Kuzminski 2018-03-01 16:46:49 +01:00
parent 0d8040e6fa
commit 6847122bc5

View file

@ -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)