1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Revert "Fix #5679 again after recent changes in core"

This reverts commit 2bfaacd170.

Fixes #6821
This commit is contained in:
James Cammarata 2014-04-07 09:42:27 -05:00
parent 318e752b6f
commit b73cddc485
2 changed files with 3 additions and 20 deletions

View file

@ -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)

View file

@ -209,21 +209,3 @@
that:
- "result.stat.md5 == 'fef1d487711facfd7aa2c87d788c19d9'"
- name: insert a multiple lines at the end of the file
lineinfile: dest={{output_dir}}/test.txt state=present line="This is a line\nwith \\\n character" insertafter="EOF"
register: result
- name: assert that the multiple lines was inserted
assert:
that:
- "result.changed == true"
- "result.msg == 'line added'"
- stat: path={{output_dir}}/test.txt
register: result
- name: assert test md5 matches after insert the multiple lines
assert:
that:
- "result.stat.md5 == 'c2510d5bc8fdef8e752b8f8e74c784c2'"