def __init__(self, name): self.__nodeusage = self.__get_nodeusage_values() self.__groupusage = self.__get_groupusage_values() self.__logger.debug('NODE USAGE: %s' % self.__nodeusage) self.__logger.debug('GROUP USAGE: %s' % self.__groupusage) freeRatio = config.get_dict('freeRatio', type=float) if freeRatio is not None: self.__freeRatio = freeRatio freeAbsolute = config.get_dict('freeAbsolute', type='size') if freeAbsolute is not None: self.__freeAbsolute = freeAbsolute targetRatio = config.get_dict('targetRatio', type=float) if targetRatio is not None: self.__targetRatio = targetRatio targetAbsolute = config.get_dict('targetAbsolute', type='size') if targetAbsolute is not None: self.__targetAbsolute = targetAbsolute centralPledge = config.get_dict('centralPledge', type=float) if centralPledge is not None: self.__centralPledge = centralPledge self.__site_name_map = self.__get_site_name_map() self.__sitedb_pledges = self.__get_sitedb_pledges()
def __init__(self, name): self.__nodeusage = self.__get_nodeusage_values() self.__groupusage = self.__get_groupusage_values() self.__logger.debug('NODE USAGE: %s' %self.__nodeusage) self.__logger.debug('GROUP USAGE: %s' %self.__groupusage) freeRatio = config.get_dict('freeRatio', type=float) if freeRatio is not None: self.__freeRatio = freeRatio freeAbsolute = config.get_dict('freeAbsolute', type='size') if freeAbsolute is not None: self.__freeAbsolute = freeAbsolute targetRatio=config.get_dict('targetRatio', type=float) if targetRatio is not None: self.__targetRatio = targetRatio targetAbsolute=config.get_dict('targetAbsolute', type='size') if targetAbsolute is not None: self.__targetAbsolute = targetAbsolute centralPledge=config.get_dict('centralPledge', type=float) if centralPledge is not None: self.__centralPledge = centralPledge self.__site_name_map = self.__get_site_name_map() self.__sitedb_pledges = self.__get_sitedb_pledges()
def __init__(self): popularityInterface = config.get_config('popularityInterface', type = str) if popularityInterface: self.__popularityInterface = popularityInterface self.__popularity = create_tool(self.__popularityInterface) creationlimit = config.get_config('creationlimit', int) if creationlimit is not None: self.__creationlimit = creationlimit thresholds = config.get_config('thresholds', list) lastaccess= config.get_config('lastaccess', 'list_2') is_parsed=self.__parseThresholds__(thresholds, lastaccess) if is_parsed: self.__logger.info('Successfully parsed the thresholds: %s'%str(self.__thresholds)) else: self.__logger.error('Failed to parse thresholds from configuration file. Using default ones: %s'%str(self.__thresholds)) # parse algorithm2 parameters algorithm2_spacetokens = config.get_config('algorithm2_spacetokens' ,list) if algorithm2_spacetokens is None: algorithm2_spacetokens = [] algorithm2_creationlimit = config.get_dict ('algorithm2_creationlimit' ,type='positive_int') self.__algorithm2_spacetokens , self.__algorithm2_creationlimit = self.__verifyAlgorithm2param(algorithm2_spacetokens, algorithm2_creationlimit) self.__logger.debug('Algorithm2_spacetokens : %s'%self.__algorithm2_spacetokens) self.__logger.debug('Algorithm2_creationlimit : %s'%self.__algorithm2_creationlimit)
def __init__(self): popularityInterface = config.get_config('popularityInterface', type = str) if popularityInterface: self.__popularityInterface = popularityInterface self.__popularity = create_tool(self.__popularityInterface) creationlimit = config.get_config('creationlimit', int) if creationlimit is not None: self.__creationlimit = creationlimit thresholds = config.get_config('thresholds', list) lastaccess= config.get_config('lastaccess', 'list_2') is_parsed=self.__parseThresholds__(thresholds, lastaccess) if is_parsed: self.__logger.info('Successfully parsed the thresholds: %s'%str(self.__thresholds)) else: self.__logger.error('Failed to parse thresholds from configuration file. Using default ones: %s'%str(self.__thresholds)) # parse algorithm2 parameters algorithm2_spacetokens = config.get_config('algorithm2_spacetokens', list) if algorithm2_spacetokens is None: algorithm2_spacetokens = [] algorithm2_creationlimit = config.get_dict ('algorithm2_creationlimit', type='positive_int') self.__algorithm2_spacetokens, self.__algorithm2_creationlimit = self.__verifyAlgorithm2param(algorithm2_spacetokens, algorithm2_creationlimit) self.__logger.debug('Algorithm2_spacetokens : %s'%self.__algorithm2_spacetokens) self.__logger.debug('Algorithm2_creationlimit : %s'%self.__algorithm2_creationlimit)