summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McCallister <mike@mccllstr.com>2011-07-22 14:26:35 -0500
committerSol Jerome <sol.jerome@gmail.com>2011-07-23 23:06:22 -0500
commitf8c5bc77648b20394278f91a40619158b27682e9 (patch)
tree275132820504f2a8a566957fb17ca556eed3bf2d
parente7c9fa9a77d2c336631745c56aa3e2fdf88ebe65 (diff)
downloadbcfg2-f8c5bc77648b20394278f91a40619158b27682e9.tar.gz
bcfg2-f8c5bc77648b20394278f91a40619158b27682e9.tar.bz2
bcfg2-f8c5bc77648b20394278f91a40619158b27682e9.zip
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)
-rw-r--r--src/lib/Server/Plugins/Deps.py7
1 files 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