Slightly more future-proof version of the lineinfile fix

This commit is contained in:
Toshio Kuratomi 2015-05-17 09:15:57 -07:00
parent 2eafbdd63a
commit 142760658f

View file

@ -19,9 +19,10 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
import pipes
import re
import os
import pipes
import codecs
import tempfile
DOCUMENTATION = """
@ -375,7 +376,7 @@ def main():
if backrefs:
line = re.sub(r'(\\[0-9]{1,3})', r'\\\1', line)
line = line.decode("string_escape")
line = codecs.escape_decode(line)
present(module, dest, params['regexp'], line,
ins_aft, ins_bef, create, backup, backrefs)
@ -388,5 +389,5 @@ def main():
# import module snippets
from ansible.module_utils.basic import *
from ansible.module_utils.splitter import *
main()
if __name__ == '__main__':
main()