From 23ae3d201af82292ad4e939569a50f2e32c689a3 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Thu, 5 May 2011 08:16:51 -0400 Subject: made bcfg2-lint error handling configurable on a much more granular level --- src/lib/Server/Lint/Bundles.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/lib/Server/Lint/Bundles.py') diff --git a/src/lib/Server/Lint/Bundles.py b/src/lib/Server/Lint/Bundles.py index 417f76c2d..e90159f7c 100644 --- a/src/lib/Server/Lint/Bundles.py +++ b/src/lib/Server/Lint/Bundles.py @@ -33,7 +33,8 @@ class Bundles(Bcfg2.Server.Lint.ServerPlugin): genshibundle = "%s.genshi" % bundle if (xmlbundle not in allbundles and genshibundle not in allbundles): - self.LintError("Bundle %s referenced, but does not exist" % + self.LintError("bundle-not-found", + "Bundle %s referenced, but does not exist" % bundle) def bundle_names(self, bundle): @@ -47,8 +48,9 @@ class Bundles(Bcfg2.Server.Lint.ServerPlugin): fname = bundle.name.split('Bundler/')[1].split('.')[0] bname = xdata.get('name') if fname != bname: - self.LintWarning("Inconsistent bundle name: filename is %s, bundle name is %s" % - (fname, bname)) + self.LintError("inconsistent-bundle-name", + "Inconsistent bundle name: filename is %s, bundle name is %s" % + (fname, bname)) def sgenshi_groups(self, bundle): """ ensure that Genshi Bundles do not include tags, @@ -57,5 +59,6 @@ class Bundles(Bcfg2.Server.Lint.ServerPlugin): groups = [self.RenderXML(g) for g in xdata.getroottree().findall("//Group")] if groups: - self.LintWarning(" tag is not allowed in SGenshi Bundle:\n%s" % - "\n".join(groups)) + self.LintError("group-tag-not-allowed", + " tag is not allowed in SGenshi Bundle:\n%s" % + "\n".join(groups)) -- cgit v1.2.3-1-g7c22