summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-05-03 15:01:54 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-05-03 15:01:54 -0400
commitbae6a04668096bbbe56ba6fd19c04becd42e016e (patch)
tree0bed6a66591e921fd2d68670b5594faa219b20d7 /src/lib/Bcfg2
parent4cf9fa76c540302b66e73bee3f58b7013ebb6d43 (diff)
downloadbcfg2-bae6a04668096bbbe56ba6fd19c04becd42e016e.tar.gz
bcfg2-bae6a04668096bbbe56ba6fd19c04becd42e016e.tar.bz2
bcfg2-bae6a04668096bbbe56ba6fd19c04becd42e016e.zip
fixed bcfg2-lint --show-errors
Diffstat (limited to 'src/lib/Bcfg2')
-rw-r--r--src/lib/Bcfg2/Server/Lint/Bundles.py3
-rw-r--r--src/lib/Bcfg2/Server/Lint/Comments.py3
-rw-r--r--src/lib/Bcfg2/Server/Lint/Deltas.py3
-rw-r--r--src/lib/Bcfg2/Server/Lint/Duplicates.py3
-rwxr-xr-xsrc/lib/Bcfg2/Server/Lint/Genshi.py3
-rw-r--r--src/lib/Bcfg2/Server/Lint/GroupPatterns.py3
-rw-r--r--src/lib/Bcfg2/Server/Lint/InfoXML.py3
-rw-r--r--src/lib/Bcfg2/Server/Lint/MergeFiles.py3
-rw-r--r--src/lib/Bcfg2/Server/Lint/Pkgmgr.py3
-rw-r--r--src/lib/Bcfg2/Server/Lint/RequiredAttrs.py3
-rw-r--r--src/lib/Bcfg2/Server/Lint/TemplateHelper.py3
-rw-r--r--src/lib/Bcfg2/Server/Lint/Validate.py3
-rw-r--r--src/lib/Bcfg2/Server/Lint/__init__.py4
13 files changed, 26 insertions, 14 deletions
diff --git a/src/lib/Bcfg2/Server/Lint/Bundles.py b/src/lib/Bcfg2/Server/Lint/Bundles.py
index 44626b462..e6b6307f2 100644
--- a/src/lib/Bcfg2/Server/Lint/Bundles.py
+++ b/src/lib/Bcfg2/Server/Lint/Bundles.py
@@ -14,7 +14,8 @@ class Bundles(Bcfg2.Server.Lint.ServerPlugin):
Bcfg2.Server.Plugins.SGenshi.SGenshiTemplateFile):
self.bundle_names(bundle)
- def Errors(self):
+ @classmethod
+ def Errors(cls):
return {"bundle-not-found":"error",
"inconsistent-bundle-name":"warning"}
diff --git a/src/lib/Bcfg2/Server/Lint/Comments.py b/src/lib/Bcfg2/Server/Lint/Comments.py
index e16469bb5..3b9370c3b 100644
--- a/src/lib/Bcfg2/Server/Lint/Comments.py
+++ b/src/lib/Bcfg2/Server/Lint/Comments.py
@@ -16,7 +16,8 @@ class Comments(Bcfg2.Server.Lint.ServerPlugin):
self.check_infoxml()
self.check_probes()
- def Errors(self):
+ @classmethod
+ def Errors(cls):
return {"unexpanded-keywords":"warning",
"keywords-not-found":"warning",
"comments-not-found":"warning",
diff --git a/src/lib/Bcfg2/Server/Lint/Deltas.py b/src/lib/Bcfg2/Server/Lint/Deltas.py
index 8d35d8e5a..611a437e9 100644
--- a/src/lib/Bcfg2/Server/Lint/Deltas.py
+++ b/src/lib/Bcfg2/Server/Lint/Deltas.py
@@ -9,7 +9,8 @@ class Deltas(Bcfg2.Server.Lint.ServerPlugin):
for basename, entry in list(cfg.entries.items()):
self.check_entry(basename, entry)
- def Errors(self):
+ @classmethod
+ def Errors(cls):
return {"cat-file-used":"warning",
"diff-file-used":"warning"}
diff --git a/src/lib/Bcfg2/Server/Lint/Duplicates.py b/src/lib/Bcfg2/Server/Lint/Duplicates.py
index abc581c4f..ee6b7a2e6 100644
--- a/src/lib/Bcfg2/Server/Lint/Duplicates.py
+++ b/src/lib/Bcfg2/Server/Lint/Duplicates.py
@@ -22,7 +22,8 @@ class Duplicates(Bcfg2.Server.Lint.ServerPlugin):
if self.clients_xdata is not None:
self.duplicate_clients()
- def Errors(self):
+ @classmethod
+ def Errors(cls):
return {"broken-xinclude-chain":"warning",
"duplicate-client":"error",
"duplicate-group":"error",
diff --git a/src/lib/Bcfg2/Server/Lint/Genshi.py b/src/lib/Bcfg2/Server/Lint/Genshi.py
index 45ddf8f2f..b6007161e 100755
--- a/src/lib/Bcfg2/Server/Lint/Genshi.py
+++ b/src/lib/Bcfg2/Server/Lint/Genshi.py
@@ -11,7 +11,8 @@ class Genshi(Bcfg2.Server.Lint.ServerPlugin):
self.check_files(self.core.plugins[plugin].entries,
loader=loader)
- def Errors(self):
+ @classmethod
+ def Errors(cls):
return {"genshi-syntax-error":"error"}
def check_files(self, entries, loader=None):
diff --git a/src/lib/Bcfg2/Server/Lint/GroupPatterns.py b/src/lib/Bcfg2/Server/Lint/GroupPatterns.py
index f50118ce1..431ba4056 100644
--- a/src/lib/Bcfg2/Server/Lint/GroupPatterns.py
+++ b/src/lib/Bcfg2/Server/Lint/GroupPatterns.py
@@ -14,7 +14,8 @@ class GroupPatterns(Bcfg2.Server.Lint.ServerPlugin):
self.check(entry, groups, ptype='NamePattern')
self.check(entry, groups, ptype='NameRange')
- def Errors(self):
+ @classmethod
+ def Errors(cls):
return {"pattern-fails-to-initialize":"error"}
def check(self, entry, groups, ptype="NamePattern"):
diff --git a/src/lib/Bcfg2/Server/Lint/InfoXML.py b/src/lib/Bcfg2/Server/Lint/InfoXML.py
index 20c218e6f..7b89e86b2 100644
--- a/src/lib/Bcfg2/Server/Lint/InfoXML.py
+++ b/src/lib/Bcfg2/Server/Lint/InfoXML.py
@@ -17,7 +17,8 @@ class InfoXML(Bcfg2.Server.Lint.ServerPlugin):
self.LintError("no-infoxml",
"No info.xml found for %s" % filename)
- def Errors(self):
+ @classmethod
+ def Errors(cls):
return {"no-infoxml":"warning",
"paranoid-false":"warning",
"broken-xinclude-chain":"warning",
diff --git a/src/lib/Bcfg2/Server/Lint/MergeFiles.py b/src/lib/Bcfg2/Server/Lint/MergeFiles.py
index 3259aca44..797de6ed9 100644
--- a/src/lib/Bcfg2/Server/Lint/MergeFiles.py
+++ b/src/lib/Bcfg2/Server/Lint/MergeFiles.py
@@ -12,7 +12,8 @@ class MergeFiles(Bcfg2.Server.Lint.ServerPlugin):
if 'Probes' in self.core.plugins:
self.check_probes()
- def Errors(self):
+ @classmethod
+ def Errors(cls):
return {"merge-cfg":"warning",
"merge-probes":"warning"}
diff --git a/src/lib/Bcfg2/Server/Lint/Pkgmgr.py b/src/lib/Bcfg2/Server/Lint/Pkgmgr.py
index 7c17d555a..ceb46238a 100644
--- a/src/lib/Bcfg2/Server/Lint/Pkgmgr.py
+++ b/src/lib/Bcfg2/Server/Lint/Pkgmgr.py
@@ -33,5 +33,6 @@ class Pkgmgr(Bcfg2.Server.Lint.ServerlessPlugin):
else:
pset.add(ptuple)
- def Errors(self):
+ @classmethod
+ def Errors(cls):
return {"duplicate-packages":"error"}
diff --git a/src/lib/Bcfg2/Server/Lint/RequiredAttrs.py b/src/lib/Bcfg2/Server/Lint/RequiredAttrs.py
index 20947d50f..6f76cf2db 100644
--- a/src/lib/Bcfg2/Server/Lint/RequiredAttrs.py
+++ b/src/lib/Bcfg2/Server/Lint/RequiredAttrs.py
@@ -37,7 +37,8 @@ class RequiredAttrs(Bcfg2.Server.Lint.ServerPlugin):
self.check_rules()
self.check_bundles()
- def Errors(self):
+ @classmethod
+ def Errors(cls):
return {"unknown-entry-type":"error",
"unknown-entry-tag":"error",
"required-attrs-missing":"error",
diff --git a/src/lib/Bcfg2/Server/Lint/TemplateHelper.py b/src/lib/Bcfg2/Server/Lint/TemplateHelper.py
index f5f916e88..be270a59c 100644
--- a/src/lib/Bcfg2/Server/Lint/TemplateHelper.py
+++ b/src/lib/Bcfg2/Server/Lint/TemplateHelper.py
@@ -54,7 +54,8 @@ class TemplateHelper(Bcfg2.Server.Lint.ServerlessPlugin):
"%s: exported symbol %s starts with underscore" %
(helper, sym))
- def Errors(self):
+ @classmethod
+ def Errors(cls):
return {"templatehelper-import-error":"error",
"templatehelper-no-export":"error",
"templatehelper-nonlist-export":"error",
diff --git a/src/lib/Bcfg2/Server/Lint/Validate.py b/src/lib/Bcfg2/Server/Lint/Validate.py
index 812ab3d00..05fedc313 100644
--- a/src/lib/Bcfg2/Server/Lint/Validate.py
+++ b/src/lib/Bcfg2/Server/Lint/Validate.py
@@ -63,7 +63,8 @@ class Validate(Bcfg2.Server.Lint.ServerlessPlugin):
self.check_properties()
- def Errors(self):
+ @classmethod
+ def Errors(cls):
return {"broken-xinclude-chain":"warning",
"schema-failed-to-parse":"warning",
"properties-schema-not-found":"warning",
diff --git a/src/lib/Bcfg2/Server/Lint/__init__.py b/src/lib/Bcfg2/Server/Lint/__init__.py
index f3991e3fc..5d7dd707b 100644
--- a/src/lib/Bcfg2/Server/Lint/__init__.py
+++ b/src/lib/Bcfg2/Server/Lint/__init__.py
@@ -63,7 +63,8 @@ class Plugin (object):
""" run the plugin. must be overloaded by child classes """
pass
- def Errors(self):
+ @classmethod
+ def Errors(cls):
""" returns a dict of errors the plugin supplies. must be
overloaded by child classes """
@@ -131,7 +132,6 @@ class ErrorHandler (object):
else:
self._handlers[err] = self.debug
-
def dispatch(self, err, msg):
if err in self._handlers:
self._handlers[err](msg)