From 1b6046c27fe116a4166b6e4385d6f3e9fe6be2bc Mon Sep 17 00:00:00 2001 From: aldbr Date: Thu, 3 Aug 2023 16:42:08 +0200 Subject: [PATCH] sweep: #7158 fix: exception when IdProviderType does not exist --- src/DIRAC/Resources/IdProvider/IdProviderFactory.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/DIRAC/Resources/IdProvider/IdProviderFactory.py b/src/DIRAC/Resources/IdProvider/IdProviderFactory.py index 6dd34c79c59..a0399ccae7b 100644 --- a/src/DIRAC/Resources/IdProvider/IdProviderFactory.py +++ b/src/DIRAC/Resources/IdProvider/IdProviderFactory.py @@ -73,8 +73,11 @@ def getIdProvider(self, name, **kwargs): pDict.update(kwargs) pDict["ProviderName"] = name - self.log.verbose(f"Creating IdProvider of {pDict['ProviderType']} type with the name {name}") - subClassName = f"{pDict['ProviderType']}IdProvider" + # Instantiating the IdProvider + # By default, OAuth2IdProvider is used + providerType = pDict.get("ProviderType", "OAuth2") + self.log.verbose(f"Creating IdProvider of {providerType} type with the name {name}") + subClassName = f"{providerType}IdProvider" objectLoader = ObjectLoader.ObjectLoader() result = objectLoader.loadObject(f"Resources.IdProvider.{subClassName}", subClassName)