Skip to content

Commit

Permalink
fix: Getting token for a specific VO in WMSUtilities
Browse files Browse the repository at this point in the history
  • Loading branch information
aldbr committed Nov 9, 2023
1 parent 08dbcdb commit 5ab8be2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/DIRAC/WorkloadManagementSystem/Service/WMSUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 5ab8be2

Please sign in to comment.