summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Lint/InfoXML.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-15 15:23:11 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-15 15:23:11 -0400
commit387fffc9ebdcb52b31fcbafba0faafef261b93eb (patch)
tree1e4bfbe2242fd3bbc582f366281dadd58dd5b9c5 /src/lib/Bcfg2/Server/Lint/InfoXML.py
parent30fc9f2e1e8f5e59fa98d9e9df6263da88b9eaed (diff)
downloadbcfg2-387fffc9ebdcb52b31fcbafba0faafef261b93eb.tar.gz
bcfg2-387fffc9ebdcb52b31fcbafba0faafef261b93eb.tar.bz2
bcfg2-387fffc9ebdcb52b31fcbafba0faafef261b93eb.zip
InfoXML bcfg2-lint plugin warns about deprecated :info/info files
Diffstat (limited to 'src/lib/Bcfg2/Server/Lint/InfoXML.py')
-rw-r--r--src/lib/Bcfg2/Server/Lint/InfoXML.py43
1 files changed, 27 insertions, 16 deletions
diff --git a/src/lib/Bcfg2/Server/Lint/InfoXML.py b/src/lib/Bcfg2/Server/Lint/InfoXML.py
index 3884c1ed4..5e4e21e18 100644
--- a/src/lib/Bcfg2/Server/Lint/InfoXML.py
+++ b/src/lib/Bcfg2/Server/Lint/InfoXML.py
@@ -1,30 +1,41 @@
-import os.path
+import os
import Bcfg2.Options
import Bcfg2.Server.Lint
from Bcfg2.Server.Plugins.Cfg.CfgInfoXML import CfgInfoXML
+from Bcfg2.Server.Plugins.Cfg.CfgLegacyInfo import CfgLegacyInfo
class InfoXML(Bcfg2.Server.Lint.ServerPlugin):
""" ensure that all config files have an info.xml file"""
def Run(self):
- for plugin in ['Cfg', 'TCheetah', 'TGenshi']:
- if plugin not in self.core.plugins:
- continue
- for filename, entryset in self.core.plugins[plugin].entries.items():
- infoxml_fname = os.path.join(entryset.path, "info.xml")
- if self.HandlesFile(infoxml_fname):
- 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)
+ if 'Cfg' not in self.core.plugins:
+ return
+
+ for filename, entryset in self.core.plugins['Cfg'].entries.items():
+ infoxml_fname = os.path.join(entryset.path, "info.xml")
+ if self.HandlesFile(infoxml_fname):
+ 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)
+
+ for entry in entryset.entries.values():
+ if isinstance(entry, CfgLegacyInfo):
+ if not self.HandlesFile(entry.path):
+ continue
+ self.LintError("deprecated-info-file",
+ "Deprecated %s file found at %s" %
+ (os.path.basename(entry.name),
+ entry.path))
@classmethod
def Errors(cls):
return {"no-infoxml":"warning",
+ "deprecated-info-file":"warning",
"paranoid-false":"warning",
"broken-xinclude-chain":"warning",
"required-infoxml-attrs-missing":"error"}