diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-09-21 13:55:05 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-09-25 11:58:47 -0400 |
commit | dd28e90f183972cc2a395094ce3e3f72e861953f (patch) | |
tree | dfe10fd66e0535763d953333ed49f6467762fbd6 /src/lib/Bcfg2/Server/Plugins/Cfg/CfgExternalCommandVerifier.py | |
parent | eec8f653c0235bde8d3a754802a4485f0d542ea3 (diff) | |
download | bcfg2-dd28e90f183972cc2a395094ce3e3f72e861953f.tar.gz bcfg2-dd28e90f183972cc2a395094ce3e3f72e861953f.tar.bz2 bcfg2-dd28e90f183972cc2a395094ce3e3f72e861953f.zip |
run pylint for errors on almost everything, full runs on some selected stuff
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Cfg/CfgExternalCommandVerifier.py')
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Cfg/CfgExternalCommandVerifier.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Cfg/CfgExternalCommandVerifier.py b/src/lib/Bcfg2/Server/Plugins/Cfg/CfgExternalCommandVerifier.py index 87e11ab6d..fb66ca8bf 100644 --- a/src/lib/Bcfg2/Server/Plugins/Cfg/CfgExternalCommandVerifier.py +++ b/src/lib/Bcfg2/Server/Plugins/Cfg/CfgExternalCommandVerifier.py @@ -7,7 +7,8 @@ import Bcfg2.Server.Plugin from subprocess import Popen, PIPE from Bcfg2.Server.Plugins.Cfg import CfgVerifier, CfgVerificationError -logger = logging.getLogger(__name__) +LOGGER = logging.getLogger(__name__) + class CfgExternalCommandVerifier(CfgVerifier): """ Invoke an external script to verify @@ -16,6 +17,11 @@ class CfgExternalCommandVerifier(CfgVerifier): #: Handle :file:`:test` files __basenames__ = [':test'] + def __init__(self, name, specific, encoding): + CfgVerifier.__init__(self, name, specific, encoding) + self.cmd = [] + __init__.__doc__ = CfgVerifier.__init__.__doc__ + def verify_entry(self, entry, metadata, data): proc = Popen(self.cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) err = proc.communicate(input=data)[1] @@ -34,8 +40,7 @@ class CfgExternalCommandVerifier(CfgVerifier): self.cmd.extend(shlex.split(bangpath[2:].strip())) else: msg = "Cannot execute %s" % self.name - logger.error(msg) + LOGGER.error(msg) raise Bcfg2.Server.Plugin.PluginExecutionError(msg) self.cmd.append(self.name) handle_event.__doc__ = CfgVerifier.handle_event.__doc__ - |