diff --git a/src/DIRAC/ConfigurationSystem/Client/VOMS2CSSynchronizer.py b/src/DIRAC/ConfigurationSystem/Client/VOMS2CSSynchronizer.py index 3c296f57f89..11aed23be7a 100644 --- a/src/DIRAC/ConfigurationSystem/Client/VOMS2CSSynchronizer.py +++ b/src/DIRAC/ConfigurationSystem/Client/VOMS2CSSynchronizer.py @@ -259,7 +259,8 @@ def syncCSWithVOMS(self): if not result["OK"]: self.log.error("Could not retrieve user information", result["Message"]) return result - + if getUserErrors := result.get("Errors", []): + self.adminMsgs["Errors"].extend(getUserErrors) self.vomsUserDict = result["Value"] message = f"There are {len(self.vomsUserDict)} user entries in VOMS for VO {self.vomsVOName}" self.adminMsgs["Info"].append(message) diff --git a/src/DIRAC/Core/Security/IAMService.py b/src/DIRAC/Core/Security/IAMService.py index a7579bd28f7..7e8d1bc923f 100644 --- a/src/DIRAC/Core/Security/IAMService.py +++ b/src/DIRAC/Core/Security/IAMService.py @@ -27,6 +27,7 @@ def __init__(self, access_token, vo=None): :param str access_token: the token used to talk to IAM, with the scim:read property """ + self.log = gLogger.getSubLogger(self.__class__.__name__) if not access_token: raise ValueError("access_token not set") @@ -127,13 +128,15 @@ def convert_iam_to_voms(iam_output): def getUsers(self): self.iam_users_raw = self._getIamUserDump() users = {} - errors = 0 + errors = [] for user in self.iam_users_raw: try: users.update(self.convert_iam_to_voms(user)) except Exception as e: - errors += 1 - print(f"Could not convert {user['name']} {e!r} ") - print(f"There were in total {errors} errors") + errors.append(f"{user['name']} {e!r}") + self.log.error("Could not convert", f"{user['name']} {e!r}") + self.log.error("There were in total", f"{len(errors)} errors") self.userDict = dict(users) - return S_OK(users) + result = S_OK(users) + result["Errors"] = errors + return result