Skip to content

Commit

Permalink
Merge pull request #7489 from chaen/v8.0_fix_proxyinfoGroup
Browse files Browse the repository at this point in the history
[8.0] fix: do not print group info when doing dirac-proxy-init
  • Loading branch information
fstagni authored Feb 29, 2024
2 parents 495785e + a393f68 commit a01a514
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/DIRAC/FrameworkSystem/scripts/dirac_proxy_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,23 +113,21 @@ def invalidProxy(msg):
if uploadedInfo:
gLogger.notice("== Proxies uploaded ==")
maxDNLen = 0
maxGroupLen = 0

for userDN in uploadedInfo:
maxDNLen = max(maxDNLen, len(userDN))
for group in uploadedInfo[userDN]:
maxGroupLen = max(maxGroupLen, len(group))
gLogger.notice(f" {'DN'.ljust(maxDNLen)} | {'Group'.ljust(maxGroupLen)} | Until (GMT)")
# for group in uploadedInfo[userDN]:
# maxGroupLen = max(maxGroupLen, len(group))
gLogger.notice(f" {'DN'.ljust(maxDNLen)} | Until (GMT)")
for userDN in uploadedInfo:
for group in uploadedInfo[userDN]:
gLogger.notice(
" %s | %s | %s"
% (
userDN.ljust(maxDNLen),
group.ljust(maxGroupLen),
uploadedInfo[userDN][group].strftime("%Y/%m/%d %H:%M"),
)
)

# in v8.0, expirationTime is accessed from uploadedInfo[userDN][""]
if isinstance(uploadedInfo[userDN], dict):
expirationTime = uploadedInfo[userDN][""]
# whereas in v9.0, expirationTime is accessed from uploadedInfo[userDN]
else:
expirationTime = uploadedInfo[userDN]

gLogger.notice(f" {userDN.ljust(maxDNLen)} | {expirationTime.strftime('%Y/%m/%d %H:%M')}")
if params.checkValid:
if infoDict["secondsLeft"] == 0:
invalidProxy("Proxy is expired")
Expand Down

0 comments on commit a01a514

Please sign in to comment.