コード例 #1
0
 def __init__(self, config, name, userOpt, itemName, discoverFun):
     Broker.__init__(self, config, name, userOpt, itemName, discoverFun)
     self._storageDict = config.getLookup(
         '%s storage access' % userOpt, {},
         onChange=None,
         parser=lambda x: parseList(x, ' '),
         strfun=lambda x: str.join(' ', x))
コード例 #2
0
ファイル: broker_basic.py プロジェクト: jolange/grid-control
	def __init__(self, config, name, broker_prefix, item_name, discover_fun):
		Broker.__init__(self, config, name, broker_prefix, item_name, discover_fun)
		user_filter = config.get_filter(broker_prefix, '',
			default_matcher='blackwhite', default_filter='try_strict',
			default_order=ListOrder.matcher)
		self._item_list_start = user_filter.get_selector()
		if self._item_list_start:
			self._discover(discover_fun)
		if self._item_list_discovered:
			self._item_list_start = user_filter.filter_list(self._item_list_discovered)
コード例 #3
0
 def __init__(self, config, name, userOpt, itemName, discoverFun):
     Broker.__init__(self, config, name, userOpt, itemName, discoverFun)
     userFilter = config.getFilter(userOpt,
                                   '',
                                   defaultMatcher='blackwhite',
                                   defaultFilter='try_strict',
                                   defaultOrder=ListOrder.matcher)
     self._itemsStart = userFilter.filterList(None)
     itemsDiscover = list(self._discover(discoverFun).keys())
     if itemsDiscover:
         self._itemsStart = userFilter.filterList(itemsDiscover)
     self._nIndex = 0
コード例 #4
0
 def __init__(self, config, name, userOpt, itemName, discoverFun):
     Broker.__init__(self, config, name, userOpt, itemName, discoverFun)
     userFilter = config.getFilter(userOpt,
                                   '',
                                   defaultMatcher='blackwhite',
                                   defaultFilter='try_strict',
                                   defaultOrder=ListOrder.matcher)
     self._itemsStart = userFilter.getSelector()
     if self._itemsStart:
         self._discover(discoverFun)
     if self._itemsDiscovered:
         self._itemsStart = userFilter.filterList(self._itemsDiscovered)
コード例 #5
0
ファイル: broker_basic.py プロジェクト: jolange/grid-control
	def _broker(self, reqs, items):
		result = Broker._broker(self, reqs, items)
		for (req_enum, req_value) in reqs:
			if (req_enum == WMS.STORAGE) and req_value:
				if result is None:
					result = []
				for rval in req_value:
					result.extend(self._storage_lookup.lookup(rval))
		return result
コード例 #6
0
 def _broker(self, reqs, items):
     result = Broker._broker(self, reqs, items)
     for (rType, rValue) in reqs:
         if (rType == WMS.STORAGE) and rValue:
             if result is None:
                 result = []
             for rval in rValue:
                 result.extend(self._storageDict.lookup(rval))
     return result
コード例 #7
0
ファイル: broker_basic.py プロジェクト: jolange/grid-control
	def __init__(self, config, name, broker_prefix, item_name, discover_fun):
		Broker.__init__(self, config, name, broker_prefix, item_name, discover_fun)
		self._item_list_start = config.get_list(broker_prefix, [], on_change=None)
		if not self._item_list_start:
			self._item_list_start = None
コード例 #8
0
ファイル: broker_basic.py プロジェクト: jolange/grid-control
	def __init__(self, config, name, broker_prefix, item_name, discover_fun):
		Broker.__init__(self, config, name, broker_prefix, item_name, discover_fun)
		self._storage_lookup = config.get_lookup('%s storage access' % broker_prefix, {}, on_change=None,
			parser=lambda x: parse_list(x, ' '), strfun=lambda x: str.join(' ', x))
コード例 #9
0
ファイル: broker_basic.py プロジェクト: jolange/grid-control
	def __init__(self, config, name, broker_prefix, item_name, discover_fun):
		Broker.__init__(self, config, name, broker_prefix, item_name, discover_fun)
		self._item_list_start = self._discover(discover_fun)
コード例 #10
0
ファイル: broker_basic.py プロジェクト: jolange/grid-control
	def _broker(self, reqs, items):
		items = Broker._broker(self, reqs, items)
		if items:
			items = [sorted(items)[self._item_idx % len(items)]]
			self._item_idx += 1
		return items
コード例 #11
0
 def __init__(self, config, name, userOpt, itemName, discoverFun):
     Broker.__init__(self, config, name, userOpt, itemName, discoverFun)
     self._itemsStart = config.getList(userOpt, [], onChange=None)
     if not self._itemsStart:
         self._itemsStart = None
コード例 #12
0
 def __init__(self, config, name, userOpt, itemName, discoverFun):
     Broker.__init__(self, config, name, userOpt, itemName, discoverFun)
     self._itemsStart = self._discover(discoverFun)