def printInfo(self): result = ProxyInfo.getProxyInfoAsString(self.__proxyGenerated) if not result['OK']: gLogger.error('Failed to get the new proxy info: %s' % result['Message']) else: gLogger.notice("Proxy generated:") gLogger.notice(result['Value']) if self.__uploadedInfo: gLogger.notice("\nProxies uploaded:") maxDNLen = 0 maxGroupLen = 0 for userDN in self.__uploadedInfo: maxDNLen = max(maxDNLen, len(userDN)) for group in self.__uploadedInfo[userDN]: maxGroupLen = max(maxGroupLen, len(group)) gLogger.notice(" %s | %s | Until (GMT)" % ("DN".ljust(maxDNLen), "Group".ljust(maxGroupLen))) for userDN in self.__uploadedInfo: for group in self.__uploadedInfo[userDN]: gLogger.notice( " %s | %s | %s" % (userDN.ljust(maxDNLen), group.ljust(maxGroupLen), self.__uploadedInfo[userDN][group].strftime( "%Y/%m/%d %H:%M")))
def printInfo(self): result = ProxyInfo.getProxyInfoAsString(self.__proxyGenerated) if not result["OK"]: gLogger.error("Failed to get the new proxy info: %s" % result["Message"]) else: gLogger.notice("Proxy generated:") gLogger.notice(result["Value"]) if self.__uploadedInfo: gLogger.notice("\nProxies uploaded:") maxDNLen = 0 maxGroupLen = 0 for userDN in self.__uploadedInfo: maxDNLen = max(maxDNLen, len(userDN)) for group in self.__uploadedInfo[userDN]: maxGroupLen = max(maxGroupLen, len(group)) gLogger.notice(" %s | %s | Until (GMT)" % ("DN".ljust(maxDNLen), "Group".ljust(maxGroupLen))) for userDN in self.__uploadedInfo: for group in self.__uploadedInfo[userDN]: gLogger.notice( " %s | %s | %s" % ( userDN.ljust(maxDNLen), group.ljust(maxGroupLen), self.__uploadedInfo[userDN][group].strftime("%Y/%m/%d %H:%M"), ) )
def printInfo( self ): gLogger.notice( "Proxy generated:" ) gLogger.notice( ProxyInfo.getProxyInfoAsString( self.__proxyGenerated )[ 'Value' ] ) if self.__uploadedInfo: gLogger.notice( "\nProxies uploaded:" ) maxDNLen = 0 maxGroupLen = 0 for userDN in self.__uploadedInfo: maxDNLen = max( maxDNLen, len( userDN ) ) for group in self.__uploadedInfo[ userDN ]: maxGroupLen = max( maxGroupLen, len( group ) ) gLogger.notice( " %s | %s | Until (GMT)" % ( "DN".ljust( maxDNLen ), "Group".ljust( maxGroupLen ) ) ) for userDN in self.__uploadedInfo: for group in self.__uploadedInfo[ userDN ]: gLogger.notice( " %s | %s | %s" % ( userDN.ljust( maxDNLen ), group.ljust( maxGroupLen ), self.__uploadedInfo[ userDN ][ group ].strftime( "%Y/%m/%d %H:%M" ) ) )
def printInfo(self): """ Printing utilities """ resultProxyInfoAsAString = ProxyInfo.getProxyInfoAsString(self.__proxyGenerated) if not resultProxyInfoAsAString['OK']: gLogger.error('Failed to get the new proxy info: %s' % resultProxyInfoAsAString['Message']) else: gLogger.notice("Proxy generated:") gLogger.notice(resultProxyInfoAsAString['Value']) if self.__uploadedInfo: gLogger.notice("\nProxies uploaded:") maxDNLen = 0 maxProviderLen = len('ProxyProvider') for userDN, data in self.__uploadedInfo.items(): maxDNLen = max(maxDNLen, len(userDN)) maxProviderLen = max(maxProviderLen, len(data['provider'])) gLogger.notice(" %s | %s | %s | SupportedGroups" % ("DN".ljust(maxDNLen), "ProxyProvider".ljust(maxProviderLen), "Until (GMT)".ljust(16))) for userDN, data in self.__uploadedInfo.items(): gLogger.notice(" %s | %s | %s | " % (userDN.ljust(maxDNLen), data['provider'].ljust(maxProviderLen), data['expirationtime'].strftime("%Y/%m/%d %H:%M").ljust(16)), ",".join(data['groups']))