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/__init__.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/__init__.py')
-rw-r--r-- | src/lib/Bcfg2/Server/Lint/__init__.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/lib/Bcfg2/Server/Lint/__init__.py b/src/lib/Bcfg2/Server/Lint/__init__.py index 526bdf159..903ee6326 100644 --- a/src/lib/Bcfg2/Server/Lint/__init__.py +++ b/src/lib/Bcfg2/Server/Lint/__init__.py @@ -1,15 +1,19 @@ """ Base classes for Lint plugins and error handling """ -import os -import sys -import time import copy import fcntl +import fnmatch +import glob +import logging +import os import struct +import sys import termios -import logging import textwrap +import time + import lxml.etree + import Bcfg2.Options import Bcfg2.Server.Core import Bcfg2.Server.Plugins @@ -145,6 +149,14 @@ class Plugin(object): xml_declaration=False).decode("UTF-8").strip() return " line %s: %s" % (element.sourceline, xml) + def list_matching_files(self, path): + """list all files matching the path in self.files or the bcfg2 repo.""" + if self.files is not None: + return fnmatch.filter(self.files, os.path.join('*', path)) + else: + return glob.glob(os.path.join(Bcfg2.Options.setup.repository, + path)) + class ErrorHandler(object): """ A class to handle errors for bcfg2-lint plugins """ |