Skip to content

Commit 79b48b1

Browse files
committed
fix: dirac-proxy-init printInfo
1 parent 970cb7a commit 79b48b1

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

src/DIRAC/FrameworkSystem/scripts/dirac_proxy_init.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -163,22 +163,19 @@ def printInfo(self):
163163
if self.__uploadedInfo:
164164
gLogger.notice("\nProxies uploaded:")
165165
maxDNLen = 0
166-
maxGroupLen = 0
167166
for userDN in self.__uploadedInfo:
168167
maxDNLen = max(maxDNLen, len(userDN))
169-
for group in self.__uploadedInfo[userDN]:
170-
maxGroupLen = max(maxGroupLen, len(group))
171-
gLogger.notice(f" {'DN'.ljust(maxDNLen)} | {'Group'.ljust(maxGroupLen)} | Until (GMT)")
168+
169+
gLogger.notice(f" {'DN'.ljust(maxDNLen)} | Until (GMT)")
172170
for userDN in self.__uploadedInfo:
173-
for group in self.__uploadedInfo[userDN]:
174-
gLogger.notice(
175-
" %s | %s | %s"
176-
% (
177-
userDN.ljust(maxDNLen),
178-
group.ljust(maxGroupLen),
179-
self.__uploadedInfo[userDN][group].strftime("%Y/%m/%d %H:%M"),
180-
)
181-
)
171+
# in v8.0, expirationTime is accessed from uploadedInfo[userDN][""]
172+
if isinstance(self.__uploadedInfo[userDN], dict):
173+
expirationTime = self.__uploadedInfo[userDN][""]
174+
# whereas in v9.0, expirationTime is accessed from uploadedInfo[userDN]
175+
else:
176+
expirationTime = self.__uploadedInfo[userDN]
177+
178+
gLogger.notice(f" {userDN.ljust(maxDNLen)} | {expirationTime.strftime('%Y/%m/%d %H:%M')}")
182179

183180
def checkCAs(self):
184181
caDir = getCAsLocation()

0 commit comments

Comments
 (0)