Author: croberts Date: 2012-04-09 16:45:49 +0000 (Mon, 09 Apr 2012) New Revision: 5285
Modified: trunk/cumin/python/cumin/inventory/system.py trunk/sage/python/sage/wallaby/wallabyoperations.py Log: Fixing BZ 802704 by allowing the wallaby node list to be restricted to the same value that the sesame node names are restricted by.
Modified: trunk/cumin/python/cumin/inventory/system.py =================================================================== --- trunk/cumin/python/cumin/inventory/system.py 2012-04-04 19:36:33 UTC (rev 5284) +++ trunk/cumin/python/cumin/inventory/system.py 2012-04-09 16:45:49 UTC (rev 5285) @@ -238,7 +238,7 @@ sqldata = super(WallabyAndSqlAdapter, self).get_data(values, options)
#now get the wallaby data - wallaby_nodes = self.app.wallaby.get_data(WBTypes.NODES) + wallaby_nodes = self.app.wallaby.get_data(WBTypes.NODES, values)
data = list() if len(sqldata) > 0 and len(wallaby_nodes) > 0: #means that we have both sesame and wallaby data
Modified: trunk/sage/python/sage/wallaby/wallabyoperations.py =================================================================== --- trunk/sage/python/sage/wallaby/wallabyoperations.py 2012-04-04 19:36:33 UTC (rev 5284) +++ trunk/sage/python/sage/wallaby/wallabyoperations.py 2012-04-09 16:45:49 UTC (rev 5285) @@ -315,7 +315,7 @@ finally: self._condition.release()
- def get_data(self, which): + def get_data(self, which, valuefilter=None): ''' Return a list of cached values for the specified category.
@@ -330,6 +330,12 @@ try: if which in self._cache: d = self._cache[which].data.values() + # Here we handle the possible filtering of node names + if which == WBTypes.NODES: + if valuefilter["nodeName"] != "%%%": + filter = valuefilter["nodeName"].replace("%", "") + if filter != "": + d = [value for value in d if value.name.find(filter) > -1] finally: self._lock.release() return d
cumin-developers@lists.fedorahosted.org