diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2014-10-20 15:35:11 -0500 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2014-10-20 15:35:11 -0500 |
commit | 541c6cd3a549942b9729ae144402ce65364e8921 (patch) | |
tree | f908c6ab8e62620b87c47e9f02cf2cc53f0744cb /src/lib/Bcfg2 | |
parent | 8db0af5fa8c3455aa816cfce0a07e3ad790307b7 (diff) | |
download | bcfg2-541c6cd3a549942b9729ae144402ce65364e8921.tar.gz bcfg2-541c6cd3a549942b9729ae144402ce65364e8921.tar.bz2 bcfg2-541c6cd3a549942b9729ae144402ce65364e8921.zip |
Fixed py2.6-ism properly
Diffstat (limited to 'src/lib/Bcfg2')
-rw-r--r-- | src/lib/Bcfg2/Client/Tools/POSIX/File.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Client/Tools/POSIX/File.py b/src/lib/Bcfg2/Client/Tools/POSIX/File.py index 80e2f6cfd..fc445e07c 100644 --- a/src/lib/Bcfg2/Client/Tools/POSIX/File.py +++ b/src/lib/Bcfg2/Client/Tools/POSIX/File.py @@ -220,8 +220,12 @@ class POSIXFile(POSIXTool): def _diff(self, content1, content2, filename=None): """ Return a unified diff of the two strings """ - fromfile = "%s (on disk)" % (filename or "") - tofile = "%s (from bcfg2)" % (filename or "") + if filename: + fromfile = "%s (on disk)" % filename + tofile = "%s (from bcfg2)" % filename + else: + fromfile = "" + tofile = "" return difflib.unified_diff(content1.split('\n'), content2.split('\n'), fromfile=fromfile, |