Skip to content

Commit

Permalink
Merge pull request DIRACGrid#7491 from DIRACGridBot/cherry-pick-2-a01…
Browse files Browse the repository at this point in the history
…a5142f-integration

[sweep:integration] fix: do not print group info when doing dirac-proxy-init
  • Loading branch information
fstagni authored Feb 29, 2024
2 parents 8c64b3d + 2161f06 commit b9879f8
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 @@ -114,23 +114,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 b9879f8

Please sign in to comment.