From 541c6cd3a549942b9729ae144402ce65364e8921 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Mon, 20 Oct 2014 15:35:11 -0500 Subject: Fixed py2.6-ism properly --- src/lib/Bcfg2/Client/Tools/POSIX/File.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/lib/Bcfg2') 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, -- cgit v1.2.3-1-g7c22