file.line: better diff

This commit is contained in:
Christophe Drevet-Droguet 2015-12-22 14:14:35 +01:00 committed by rallytime
parent 24ead62c41
commit 3ebb8249d7

View file

@ -1625,7 +1625,7 @@ def line(path, content, match=None, mode=None, location=None,
if changed:
if show_changes:
changes_diff = ''.join(difflib.unified_diff(salt.utils.fopen(path, 'r').readlines(), body.splitlines()))
changes_diff = ''.join(difflib.unified_diff(salt.utils.fopen(path, 'r').read().splitlines(), body.splitlines()))
fh_ = None
try:
fh_ = salt.utils.atomicfile.atomic_open(path, 'w')