diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2015-02-17 08:55:23 -0600 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2015-02-17 09:05:10 -0600 |
commit | 6491d368d40f3de7d6c49b69b782497151d050a5 (patch) | |
tree | fff48c07ef6ff75b4e27e717cf12e3574f60db35 /src/lib/Bcfg2/Server/Lint/Validate.py | |
parent | f4d30301fd4b7dca4375875aedae59e5c3542a34 (diff) | |
download | bcfg2-6491d368d40f3de7d6c49b69b782497151d050a5.tar.gz bcfg2-6491d368d40f3de7d6c49b69b782497151d050a5.tar.bz2 bcfg2-6491d368d40f3de7d6c49b69b782497151d050a5.zip |
Pylint fixes for pylint 0.28
This also pins Pylint to 0.28 or older so that we don't have to do
this again. At some point we should look at upgrading to Pylint 1.x.
Diffstat (limited to 'src/lib/Bcfg2/Server/Lint/Validate.py')
-rw-r--r-- | src/lib/Bcfg2/Server/Lint/Validate.py | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/lib/Bcfg2/Server/Lint/Validate.py b/src/lib/Bcfg2/Server/Lint/Validate.py index cab5d248d..d6f18afbb 100644 --- a/src/lib/Bcfg2/Server/Lint/Validate.py +++ b/src/lib/Bcfg2/Server/Lint/Validate.py @@ -1,11 +1,15 @@ -""" Ensure that all XML files in the Bcfg2 repository validate -according to their respective schemas. """ +"""Validate XML files. +Ensure that all XML files in the Bcfg2 repository validate according +to their respective schemas. +""" + +import glob import os import sys -import glob -import fnmatch + import lxml.etree + import Bcfg2.Options import Bcfg2.Server.Lint from Bcfg2.Utils import Executor @@ -206,17 +210,10 @@ class Validate(Bcfg2.Server.Lint.ServerlessPlugin): values are lists of the full paths to all files in the Bcfg2 repository (or given with ``bcfg2-lint --stdin``) that match the glob.""" - if self.files is not None: - listfiles = lambda p: fnmatch.filter(self.files, - os.path.join('*', p)) - else: - listfiles = lambda p: \ - glob.glob(os.path.join(Bcfg2.Options.setup.repository, p)) - for path in self.filesets.keys(): if '/**/' in path: if self.files is not None: - self.filelists[path] = listfiles(path) + self.filelists[path] = self.list_matching_files(path) else: # self.files is None fpath, fname = path.split('/**/') self.filelists[path] = [] @@ -227,9 +224,9 @@ class Validate(Bcfg2.Server.Lint.ServerlessPlugin): for f in files if f == fname]) else: - self.filelists[path] = listfiles(path) + self.filelists[path] = self.list_matching_files(path) - self.filelists['props'] = listfiles("Properties/*.xml") + self.filelists['props'] = self.list_matching_files("Properties/*.xml") def _load_schema(self, filename): """ Load an XML schema document, returning the Schema object |