summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Cfg/CfgDiffFilter.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-09-21 13:55:05 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-09-25 11:58:47 -0400
commitdd28e90f183972cc2a395094ce3e3f72e861953f (patch)
treedfe10fd66e0535763d953333ed49f6467762fbd6 /src/lib/Bcfg2/Server/Plugins/Cfg/CfgDiffFilter.py
parenteec8f653c0235bde8d3a754802a4485f0d542ea3 (diff)
downloadbcfg2-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/CfgDiffFilter.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Cfg/CfgDiffFilter.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Cfg/CfgDiffFilter.py b/src/lib/Bcfg2/Server/Plugins/Cfg/CfgDiffFilter.py
index 409d2cbf6..00b95c970 100644
--- a/src/lib/Bcfg2/Server/Plugins/Cfg/CfgDiffFilter.py
+++ b/src/lib/Bcfg2/Server/Plugins/Cfg/CfgDiffFilter.py
@@ -7,7 +7,8 @@ import Bcfg2.Server.Plugin
from subprocess import Popen, PIPE
from Bcfg2.Server.Plugins.Cfg import CfgFilter
-logger = logging.getLogger(__name__)
+LOGGER = logging.getLogger(__name__)
+
class CfgDiffFilter(CfgFilter):
""" CfgDiffFilter applies diffs to plaintext
@@ -24,14 +25,15 @@ class CfgDiffFilter(CfgFilter):
open(basename, 'w').write(data)
os.close(basehandle)
- cmd = ["patch", "-u", "-f", basefile.name]
+ cmd = ["patch", "-u", "-f", basename]
patch = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
stderr = patch.communicate(input=self.data)[1]
ret = patch.wait()
- output = open(basefile.name, 'r').read()
- os.unlink(basefile.name)
+ output = open(basename, 'r').read()
+ os.unlink(basename)
if ret != 0:
- logger.error("Error applying diff %s: %s" % (delta.name, stderr))
- raise Bcfg2.Server.Plugin.PluginExecutionError('delta', delta)
+ msg = "Error applying diff %s: %s" % (self.name, stderr)
+ LOGGER.error(msg)
+ raise Bcfg2.Server.Plugin.PluginExecutionError(msg)
return output
modify_data.__doc__ = CfgFilter.modify_data.__doc__