def __init__(self, config, name, userOpt, itemName, discoverFun):
		Broker.__init__(self, config, name, userOpt, itemName, discoverFun)
		itemsUser = config.getList(userOpt, [], onChange = None)
		if not itemsUser:
			itemsUser = None
		itemsDisc = self._discover(discoverFun).keys()
		self._itemsStart = itemsDisc
		if itemsDisc and itemsUser:
			self._itemsStart = utils.filterBlackWhite(itemsDisc, itemsUser)
		elif not itemsDisc:
			self._itemsStart = utils.filterBlackWhite(itemsUser, itemsUser)
		self._nIndex = 0
示例#2
0
	def nodeFilter(self, nameSiteDB, complete):
		# Remove T0 and T1 by default
		result = not (nameSiteDB.startswith('T0_') or nameSiteDB.startswith('T1_'))
		# check if listed on the accepted list
		if self.phedexT1 in ['accept', 'disk']:
			result = result or (len(utils.filterBlackWhite([nameSiteDB], self.phedexWL)) != 0)
		if self.phedexT1 == 'disk':
			result = result or nameSiteDB.lower().endswith('_disk')
		# apply phedex blacklist
		result = result and (len(utils.filterBlackWhite([nameSiteDB], self.phedexBL)) != 0)
		# check for completeness at the site
		result = result and (complete or not self.onlyComplete)
		return result
	def __init__(self, config, name, userOpt, itemName, discoverFun):
		UserBroker.__init__(self, config, name, userOpt, itemName, discoverFun)
		if self._itemsStart:
			self._discover(discoverFun)
		if self._itemsDiscovered:
			self._itemsStart = utils.filterBlackWhite(self._itemsDiscovered, self._itemsStart, addUnmatched = True)