diff options
Diffstat (limited to 'src')
-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, |