diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2011-05-05 08:16:51 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2011-05-05 08:16:51 -0400 |
commit | 23ae3d201af82292ad4e939569a50f2e32c689a3 (patch) | |
tree | 96c1f029b0a5541c63a97a42bd9006c73c532038 /src/lib/Server/Lint/InfoXML.py | |
parent | 9d68095482ffe50fd0f86ab6119fc55064dcb56f (diff) | |
download | bcfg2-23ae3d201af82292ad4e939569a50f2e32c689a3.tar.gz bcfg2-23ae3d201af82292ad4e939569a50f2e32c689a3.tar.bz2 bcfg2-23ae3d201af82292ad4e939569a50f2e32c689a3.zip |
made bcfg2-lint error handling configurable on a much more granular level
Diffstat (limited to 'src/lib/Server/Lint/InfoXML.py')
-rw-r--r-- | src/lib/Server/Lint/InfoXML.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/Server/Lint/InfoXML.py b/src/lib/Server/Lint/InfoXML.py index 25f609902..7725ad748 100644 --- a/src/lib/Server/Lint/InfoXML.py +++ b/src/lib/Server/Lint/InfoXML.py @@ -14,9 +14,9 @@ class InfoXML(Bcfg2.Server.Lint.ServerPlugin): if (hasattr(entryset, "infoxml") and entryset.infoxml is not None): self.check_infoxml(entryset.infoxml.pnode.data) - elif ("require" in self.config and - self.config["require"].lower != "false"): - self.LintError("No info.xml found for %s" % filename) + else: + self.LintError("no-infoxml", + "No info.xml found for %s" % filename) def check_infoxml(self, xdata): for info in xdata.getroottree().findall("//Info"): @@ -26,18 +26,18 @@ class InfoXML(Bcfg2.Server.Lint.ServerPlugin): missing = [attr for attr in required if info.get(attr) is None] if missing: - self.LintError("Required attribute(s) %s not found in %s:%s" % + self.LintError("required-infoxml-attrs-missing", + "Required attribute(s) %s not found in %s:%s" % (",".join(missing), infoxml_fname, self.RenderXML(info))) - if ("require_paranoid" in self.config and - self.config["require_paranoid"].lower() == "true" and - (Bcfg2.Options.MDATA_PARANOID.value and + if ((Bcfg2.Options.MDATA_PARANOID.value and info.get("paranoid") is not None and info.get("paranoid").lower() == "false") or (not Bcfg2.Options.MDATA_PARANOID.value and (info.get("paranoid") is None or info.get("paranoid").lower() != "true"))): - self.LintError("Paranoid must be true in %s:%s" % + self.LintError("paranoid-false", + "Paranoid must be true in %s:%s" % (infoxml_fname, self.RenderXML(info))) |