From 07096c454d3a75a868f86ba8ce2f3678af934808 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Fri, 20 Apr 2012 11:59:53 -0400 Subject: changed the way bcfg2-lint errors are loaded to make it easier to write and use custom plugins --- src/lib/Bcfg2/Server/Lint/Bundles.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src/lib/Bcfg2/Server/Lint/Bundles.py') diff --git a/src/lib/Bcfg2/Server/Lint/Bundles.py b/src/lib/Bcfg2/Server/Lint/Bundles.py index 0c95f7e72..44626b462 100644 --- a/src/lib/Bcfg2/Server/Lint/Bundles.py +++ b/src/lib/Bcfg2/Server/Lint/Bundles.py @@ -3,7 +3,6 @@ import Bcfg2.Server.Lint class Bundles(Bcfg2.Server.Lint.ServerPlugin): """ Perform various bundle checks """ - def Run(self): """ run plugin """ if 'Bundler' in self.core.plugins: @@ -15,6 +14,10 @@ class Bundles(Bcfg2.Server.Lint.ServerPlugin): Bcfg2.Server.Plugins.SGenshi.SGenshiTemplateFile): self.bundle_names(bundle) + def Errors(self): + return {"bundle-not-found":"error", + "inconsistent-bundle-name":"warning"} + def missing_bundles(self): """ find bundles listed in Metadata but not implemented in Bundler """ if self.files is None: @@ -48,14 +51,3 @@ class Bundles(Bcfg2.Server.Lint.ServerPlugin): 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, - which are not supported """ - xdata = lxml.etree.parse(bundle.name) - groups = [self.RenderXML(g) - for g in xdata.getroottree().findall("//Group")] - if 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