summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Lint/RequiredAttrs.py
diff options
context:
space:
mode:
authorJonathan Billings <jsbillin@umich.edu>2011-04-25 11:32:58 -0400
committerJonathan Billings <jsbillin@umich.edu>2011-04-25 11:32:58 -0400
commitc7a2034df875624889d6a42290e0f6e5b14ff23f (patch)
tree01ad39e8b09c405355d0acb4bb2de8730a4581c4 /src/lib/Server/Lint/RequiredAttrs.py
parentb748d1a5fde80fa18913b67ae6eccf415d78fed3 (diff)
parent5f7092b061cb200afef2eff2aa39fc150a6ea838 (diff)
downloadbcfg2-c7a2034df875624889d6a42290e0f6e5b14ff23f.tar.gz
bcfg2-c7a2034df875624889d6a42290e0f6e5b14ff23f.tar.bz2
bcfg2-c7a2034df875624889d6a42290e0f6e5b14ff23f.zip
Merge remote-tracking branch 'upstream/master' into removefix
Diffstat (limited to 'src/lib/Server/Lint/RequiredAttrs.py')
-rw-r--r--src/lib/Server/Lint/RequiredAttrs.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/lib/Server/Lint/RequiredAttrs.py b/src/lib/Server/Lint/RequiredAttrs.py
index 7215fe163..70ce4fe0a 100644
--- a/src/lib/Server/Lint/RequiredAttrs.py
+++ b/src/lib/Server/Lint/RequiredAttrs.py
@@ -34,14 +34,15 @@ class RequiredAttrs(Bcfg2.Server.Lint.ServerPlugin):
def check_bundles(self):
""" check bundles for BoundPath entries with missing attrs """
- for bundle in self.core.plugins['Bundler'].entries.values():
- try:
- xdata = lxml.etree.XML(bundle.data)
- except AttributeError:
- xdata = lxml.etree.parse(bundle.template.filepath).getroot()
+ if 'Bundler' in self.core.plugins:
+ for bundle in self.core.plugins['Bundler'].entries.values():
+ try:
+ xdata = lxml.etree.XML(bundle.data)
+ except AttributeError:
+ xdata = lxml.etree.parse(bundle.template.filepath).getroot()
- for path in xdata.xpath("//BoundPath"):
- self.check_entry(path, bundle.name)
+ for path in xdata.xpath("//BoundPath"):
+ self.check_entry(path, bundle.name)
def check_entry(self, entry, filename):
""" generic entry check """