use the right way to unescape line string
Reference https://github.com/ansible/ansible/issues/10864
This commit is contained in:
parent
fbaeee5dba
commit
823adbbe36
1 changed files with 0 additions and 9 deletions
|
@ -22,7 +22,6 @@
|
|||
import re
|
||||
import os
|
||||
import pipes
|
||||
import codecs
|
||||
import tempfile
|
||||
|
||||
DOCUMENTATION = """
|
||||
|
@ -370,14 +369,6 @@ def main():
|
|||
|
||||
line = params['line']
|
||||
|
||||
# Replace escape sequences like '\n' while being sure
|
||||
# not to replace octal escape sequences (\ooo) since they
|
||||
# match the backref syntax.
|
||||
if backrefs:
|
||||
line = re.sub(r'(\\[0-9]{1,3})', r'\\\1', line)
|
||||
|
||||
line = codecs.escape_decode(line)[0]
|
||||
|
||||
present(module, dest, params['regexp'], line,
|
||||
ins_aft, ins_bef, create, backup, backrefs)
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue