Skip to content

Commit

Permalink
fix: proxies have no groups (since a while!)
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Jan 22, 2024
1 parent 36157c4 commit d4401fc
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/DIRAC/FrameworkSystem/Client/ProxyManagerClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,17 +639,14 @@ def getVOMSAttributes(self, chain):
"""
return VOMS().getVOMSAttributes(chain)

def getUploadedProxyLifeTime(self, DN, group=None):
def getUploadedProxyLifeTime(self, DN):
"""Get the remaining seconds for an uploaded proxy
:param str DN: user DN
:param str group: group
:return: S_OK(int)/S_ERROR()
"""
parameters = dict(UserDN=[DN])
if group:
parameters["UserGroup"] = [group]
result = self.getDBContents(parameters)
if not result["OK"]:
return result
Expand All @@ -658,10 +655,9 @@ def getUploadedProxyLifeTime(self, DN, group=None):
return S_OK(0)
pNames = list(data["ParameterNames"])
dnPos = pNames.index("UserDN")
groupPos = pNames.index("UserGroup")
expiryPos = pNames.index("ExpirationTime")
for row in data["Records"]:
if DN == row[dnPos] and group == row[groupPos]:
if DN == row[dnPos]:
td = row[expiryPos] - datetime.datetime.utcnow()
secondsLeft = td.days * 86400 + td.seconds
return S_OK(max(0, secondsLeft))
Expand Down

0 comments on commit d4401fc

Please sign in to comment.