summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins/Deps.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-01-06 17:32:51 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-01-06 17:32:51 +0000
commitd887ad88674aef96f96ab0ff97c54617b8d715e7 (patch)
tree12b1da1a6b3943a2534c3dd7cbda342a79dfeb5e /src/lib/Server/Plugins/Deps.py
parenta9388f7859586d5d98e815efdcf8d6a85b973bef (diff)
downloadbcfg2-d887ad88674aef96f96ab0ff97c54617b8d715e7.tar.gz
bcfg2-d887ad88674aef96f96ab0ff97c54617b8d715e7.tar.bz2
bcfg2-d887ad88674aef96f96ab0ff97c54617b8d715e7.zip
Implement generic structure validators and reimplement Deps as one
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5005 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Plugins/Deps.py')
-rw-r--r--src/lib/Server/Plugins/Deps.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/Server/Plugins/Deps.py b/src/lib/Server/Plugins/Deps.py
index cd9c4b79f..e61c7c029 100644
--- a/src/lib/Server/Plugins/Deps.py
+++ b/src/lib/Server/Plugins/Deps.py
@@ -34,7 +34,8 @@ class DNode(Bcfg2.Server.Plugin.INode):
class DepXMLSrc(Bcfg2.Server.Plugin.XMLSrc):
__node__ = DNode
-class Deps(Bcfg2.Server.Plugin.PrioDir):
+class Deps(Bcfg2.Server.Plugin.PrioDir,
+ Bcfg2.Server.Plugin.StructureValidator):
name = 'Deps'
__version__ = '$Id:$'
__author__ = 'bcfg-dev@mcs.anl.gov'
@@ -42,13 +43,14 @@ class Deps(Bcfg2.Server.Plugin.PrioDir):
def __init__(self, core, datastore):
Bcfg2.Server.Plugin.PrioDir.__init__(self, core, datastore)
+ Bcfg2.Server.Plugin.StructureValidator.__init__(self)
self.cache = {}
def HandleEvent(self, event):
self.cache = {}
Bcfg2.Server.Plugin.PrioDir.HandleEvent(self, event)
- def GeneratePrereqs(self, structures, metadata):
+ def validate_structures(self, metadata, structures):
entries = []
prereqs = []
for structure in structures:
@@ -96,4 +98,4 @@ class Deps(Bcfg2.Server.Plugin.PrioDir):
lxml.etree.SubElement(newstruct, tag, name=name)
except:
self.logger.error("Failed to add dep entry for %s:%s" % (tag, name))
- return newstruct
+ structures.append(newstruct)