From f8c5bc77648b20394278f91a40619158b27682e9 Mon Sep 17 00:00:00 2001 From: Mike McCallister Date: Fri, 22 Jul 2011 14:26:35 -0500 Subject: Fixed to accommodate changes made to Plugin.py in changeset 3291a875339a7e5569d4. The changes to the INode.Match() function in changeset 3291a875339a7e5569d4 caused breakage in the Deps plugin, as it inherits from INode. This commit adjusts the definition of the predicate function in Deps.py to mirror the changes made to INode in Plugin.py, eliminating the error about the wrong number of parameters being passed to the lambda function. (cherry picked from commit e496fb95eaf9200f78248106f9fd7ec6b7d9e530) --- src/lib/Server/Plugins/Deps.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/Server/Plugins/Deps.py b/src/lib/Server/Plugins/Deps.py index b186258cb..389645232 100644 --- a/src/lib/Server/Plugins/Deps.py +++ b/src/lib/Server/Plugins/Deps.py @@ -8,18 +8,19 @@ import Bcfg2.Server.Plugin class DNode(Bcfg2.Server.Plugin.INode): """DNode provides supports for single predicate types for dependencies.""" - raw = {'Group': "lambda x:'%s' in x.groups and predicate(x)"} + raw = {'Group': "lambda m, e:'%(name)s' in m.groups and predicate(m, e)"} containers = ['Group'] def __init__(self, data, idict, parent=None): self.data = data self.contents = {} if parent == None: - self.predicate = lambda x: True + self.predicate = lambda x, d: True else: predicate = parent.predicate if data.tag in list(self.raw.keys()): - self.predicate = eval(self.raw[data.tag] % (data.get('name')), + self.predicate = eval(self.raw[data.tag] % + {'name': data.get('name')}, {'predicate': predicate}) else: raise Exception -- cgit v1.2.3-1-g7c22