load only required plugins

This commit is contained in:
Devaev Maxim
2019-04-28 21:01:03 +03:00
parent 26338c5acf
commit e13b5027d6
7 changed files with 22 additions and 38 deletions

View File

@@ -35,7 +35,7 @@ from kvmd.plugins.auth import get_auth_service_class
@contextlib.asynccontextmanager
async def get_configured_auth_service(name: str, **kwargs: Any) -> AsyncGenerator[BaseAuthService, None]:
service_class = get_auth_service_class(name)
config = make_config(kwargs, service_class.get_options())
config = make_config(kwargs, service_class.get_plugin_options())
service = service_class(**config._unpack()) # pylint: disable=protected-access
try:
yield service