summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Lint/InfoXML.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-05-09 10:03:27 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-05-09 10:03:27 -0400
commitd98fee9781467d992895284c12123dc872158769 (patch)
treee44c01124166909b70c42f5479f81f9cead37bbb /src/lib/Bcfg2/Server/Lint/InfoXML.py
parentdfea47363d1e85b953815781f956713f954cc1dd (diff)
downloadbcfg2-d98fee9781467d992895284c12123dc872158769.tar.gz
bcfg2-d98fee9781467d992895284c12123dc872158769.tar.bz2
bcfg2-d98fee9781467d992895284c12123dc872158769.zip
fixed more bcfg2-lint plugins for Cfg modularization
Diffstat (limited to 'src/lib/Bcfg2/Server/Lint/InfoXML.py')
-rw-r--r--src/lib/Bcfg2/Server/Lint/InfoXML.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/lib/Bcfg2/Server/Lint/InfoXML.py b/src/lib/Bcfg2/Server/Lint/InfoXML.py
index 7b89e86b2..db6aeea73 100644
--- a/src/lib/Bcfg2/Server/Lint/InfoXML.py
+++ b/src/lib/Bcfg2/Server/Lint/InfoXML.py
@@ -1,6 +1,7 @@
import os.path
import Bcfg2.Options
import Bcfg2.Server.Lint
+from Bcfg2.Server.Plugins.Cfg.CfgInfoXML import CfgInfoXML
class InfoXML(Bcfg2.Server.Lint.ServerPlugin):
""" ensure that all config files have an info.xml file"""
@@ -9,11 +10,13 @@ class InfoXML(Bcfg2.Server.Lint.ServerPlugin):
for filename, entryset in self.core.plugins['Cfg'].entries.items():
infoxml_fname = os.path.join(entryset.path, "info.xml")
if self.HandlesFile(infoxml_fname):
- if (hasattr(entryset, "infoxml") and
- entryset.infoxml is not None):
- self.check_infoxml(infoxml_fname,
- entryset.infoxml.pnode.data)
- else:
+ found = False
+ for entry in entryset.entries.values():
+ if isinstance(entry, CfgInfoXML):
+ self.check_infoxml(infoxml_fname,
+ entry.infoxml.pnode.data)
+ found = True
+ if not found:
self.LintError("no-infoxml",
"No info.xml found for %s" % filename)