From 7a03cc69e19fea7472ac22424e4e51f4e0e5e8f8 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Mon, 7 Apr 2014 09:42:27 -0500 Subject: [PATCH] Revert "Fix #5679 again after recent changes in core" This reverts commit 2bfaacd17063ed52ceca53f55861acb7ff655c66. Fixes #6821 --- files/lineinfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/files/lineinfile b/files/lineinfile index 06e946f130b..f781911ccd1 100644 --- a/files/lineinfile +++ b/files/lineinfile @@ -351,8 +351,9 @@ def main(): if ins_bef is None and ins_aft is None: ins_aft = 'EOF' - # Replace the newline character with an actual newline. - line = params['line'].decode('string_escape') + # Replace the newline character with an actual newline. Don't replace + # escaped \\n, hence sub and not str.replace. + line = re.sub(r'\n', os.linesep, params['line']) present(module, dest, params['regexp'], line, ins_aft, ins_bef, create, backup, backrefs)