diff --git a/files/blockinfile.py b/files/blockinfile.py index 37d89ca2c88..81834dfd2da 100644 --- a/files/blockinfile.py +++ b/files/blockinfile.py @@ -280,7 +280,9 @@ def main(): lines[n0:n0] = blocklines if lines: - result = '\n'.join(lines)+'\n' + result = '\n'.join(lines) + if original.endswith('\n'): + result += '\n' else: result = '' if original == result: