diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-05-09 09:36:30 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-05-09 09:36:30 -0400 |
commit | dfea47363d1e85b953815781f956713f954cc1dd (patch) | |
tree | ef57a426c03eb63948367975da48f1f786537288 /src/lib | |
parent | c35347887bb3d452d6104b13308d853b3da44b68 (diff) | |
download | bcfg2-dfea47363d1e85b953815781f956713f954cc1dd.tar.gz bcfg2-dfea47363d1e85b953815781f956713f954cc1dd.tar.bz2 bcfg2-dfea47363d1e85b953815781f956713f954cc1dd.zip |
fixed bcfg2-lint Deltas plugin
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Bcfg2/Server/Lint/Deltas.py | 14 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Cfg/CfgCheetahGenerator.py | 2 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Cfg/CfgGenshiGenerator.py | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/Bcfg2/Server/Lint/Deltas.py b/src/lib/Bcfg2/Server/Lint/Deltas.py index de2e0668f..114f2e348 100644 --- a/src/lib/Bcfg2/Server/Lint/Deltas.py +++ b/src/lib/Bcfg2/Server/Lint/Deltas.py @@ -1,4 +1,5 @@ import Bcfg2.Server.Lint +from Bcfg2.Server.Plugins.Cfg import CfgFilter class Deltas(Bcfg2.Server.Lint.ServerPlugin): """ Warn about usage of .cat and .diff files """ @@ -16,10 +17,9 @@ class Deltas(Bcfg2.Server.Lint.ServerPlugin): "diff-file-used":"warning"} def check_entry(self, basename, entry): - for fname in list(entry.entries.keys()): - if self.HandlesFile(fname): - match = entry.specific.delta_reg.match(fname) - if match: - self.LintError("%s-file-used" % match.group('delta'), - "%s file used on %s: %s" % - (match.group('delta'), basename, fname)) + for fname, processor in entry.entries.items(): + if self.HandlesFile(fname) and isinstance(processor, CfgFilter): + extension = fname.split(".")[-1] + self.LintError("%s-file-used" % extension, + "%s file used on %s: %s" % + (extension, basename, fname)) diff --git a/src/lib/Bcfg2/Server/Plugins/Cfg/CfgCheetahGenerator.py b/src/lib/Bcfg2/Server/Plugins/Cfg/CfgCheetahGenerator.py index 08f01e005..3edd1d8cb 100644 --- a/src/lib/Bcfg2/Server/Plugins/Cfg/CfgCheetahGenerator.py +++ b/src/lib/Bcfg2/Server/Plugins/Cfg/CfgCheetahGenerator.py @@ -9,7 +9,7 @@ try: import Cheetah.Template import Cheetah.Parser have_cheetah = True -except: +except ImportError: have_cheetah = False diff --git a/src/lib/Bcfg2/Server/Plugins/Cfg/CfgGenshiGenerator.py b/src/lib/Bcfg2/Server/Plugins/Cfg/CfgGenshiGenerator.py index 5e3b37127..70a519969 100644 --- a/src/lib/Bcfg2/Server/Plugins/Cfg/CfgGenshiGenerator.py +++ b/src/lib/Bcfg2/Server/Plugins/Cfg/CfgGenshiGenerator.py @@ -9,7 +9,7 @@ try: import genshi.core from genshi.template import TemplateLoader, NewTextTemplate have_genshi = True -except: +except ImportError: have_genshi = False # snipped from TGenshi |