From 5ab8be2821e0ad6ee1b186ace85eb2828158f5d6 Mon Sep 17 00:00:00 2001 From: aldbr Date: Thu, 9 Nov 2023 13:30:48 +0100 Subject: [PATCH] fix: Getting token for a specific VO in WMSUtilities --- src/DIRAC/WorkloadManagementSystem/Service/WMSUtilities.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/DIRAC/WorkloadManagementSystem/Service/WMSUtilities.py b/src/DIRAC/WorkloadManagementSystem/Service/WMSUtilities.py index dde68b3552d..3890a487b9c 100644 --- a/src/DIRAC/WorkloadManagementSystem/Service/WMSUtilities.py +++ b/src/DIRAC/WorkloadManagementSystem/Service/WMSUtilities.py @@ -6,7 +6,7 @@ from DIRAC import S_OK, S_ERROR, gLogger, gConfig from DIRAC.ConfigurationSystem.Client.Helpers.Resources import getQueue -from DIRAC.ConfigurationSystem.Client.Helpers.Registry import getGroupOption, getUsernameForDN +from DIRAC.ConfigurationSystem.Client.Helpers.Registry import getGroupOption, getUsernameForDN, getVOForGroup from DIRAC.FrameworkSystem.Client.ProxyManagerClient import gProxyManager from DIRAC.FrameworkSystem.Client.TokenManagerClient import gTokenManager from DIRAC.Resources.Computing.ComputingElementFactory import ComputingElementFactory @@ -75,7 +75,8 @@ def setPilotCredentials(ce, pilotDict): :param pilotDict: pilot parameter dictionary :return: S_OK/S_ERROR """ - if "Token" in ce.ceParameters.get("Tag", []): + vo = getVOForGroup(pilotDict["OwnerGroup"]) + if "Token" in ce.ceParameters.get("Tag", []) or f"Token:{vo}" in ce.ceParameters.get("Tag", []): result = gTokenManager.getToken( userGroup=pilotDict["OwnerGroup"], scope=PILOT_SCOPES,