From d98fee9781467d992895284c12123dc872158769 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Wed, 9 May 2012 10:03:27 -0400 Subject: fixed more bcfg2-lint plugins for Cfg modularization --- src/lib/Bcfg2/Server/Lint/InfoXML.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/lib/Bcfg2/Server/Lint/InfoXML.py') 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) -- cgit v1.2.3-1-g7c22