Skip to content

Commit

Permalink
fix: do not check for Group
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Mar 18, 2024
1 parent 6cc7290 commit 8f178e6
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/DIRAC/FrameworkSystem/Client/ProxyManagerClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,13 +682,11 @@ def getUploadedProxyLifeTime(self, DN, group=None):
"""Get the remaining seconds for an uploaded proxy
:param str DN: user DN
:param str group: group
:param str group: group (obsolete and ignored)
: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 @@ -697,10 +695,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 8f178e6

Please sign in to comment.