Skip to content

Commit 7a9be13

Browse files
chaenfstagni
authored andcommitted
feat: getVOFromProxyGroup calls getVO directly
1 parent ee284ab commit 7a9be13

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/DIRAC/Core/Security/ProxyInfo.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
"""
2-
Set of utilities to retrieve Information from proxy
2+
Set of utilities to retrieve Information from proxy
33
"""
4+
45
import base64
56

67
from DIRAC import S_ERROR, S_OK, gLogger
78
from DIRAC.ConfigurationSystem.Client.Helpers import Registry
9+
from DIRAC.ConfigurationSystem.Client.Helpers.CSGlobals import getVO
10+
811
from DIRAC.Core.Security import Locations
912
from DIRAC.Core.Security.DiracX import diracxTokenFromPEM
1013
from DIRAC.Core.Security.VOMS import VOMS
@@ -207,10 +210,11 @@ def getVOfromProxyGroup():
207210
"""
208211
Return the VO associated to the group in the proxy
209212
"""
210-
voName = Registry.getVOForGroup("NoneExistingGroup")
213+
211214
ret = getProxyInfo(disableVOMS=True)
212-
if not ret["OK"]:
213-
return S_OK(voName)
214-
if "group" in ret["Value"]:
215+
if not ret["OK"] or "group" not in ret["Value"]:
216+
voName = getVO()
217+
else:
215218
voName = Registry.getVOForGroup(ret["Value"]["group"])
219+
216220
return S_OK(voName)

0 commit comments

Comments
 (0)