diff options
author | Anton Baklanov <antonbaklanov@gmail.com> | 2017-09-08 19:52:43 -0300 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2017-09-09 12:49:24 -0700 |
commit | 1478d0fcf302a3df2bd2894d1045c05fbf575376 (patch) | |
tree | c4e02a573ec0f0e084cb28792b5a03fdf3c9f4ab /lib/ansible | |
parent | 75309386d7f70873951e10931770a5f74e827ced (diff) | |
download | ansible-1478d0fcf302a3df2bd2894d1045c05fbf575376.tar.gz |
Fixes #26793: convert insert regex to_bytes before searching
(cherry picked from commit fcad4f38b4d9f21be0fc9f65609f8a322cba076a)
Diffstat (limited to 'lib/ansible')
-rw-r--r-- | lib/ansible/modules/files/blockinfile.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ansible/modules/files/blockinfile.py b/lib/ansible/modules/files/blockinfile.py index 6c82179b31..fe050b594c 100644 --- a/lib/ansible/modules/files/blockinfile.py +++ b/lib/ansible/modules/files/blockinfile.py @@ -253,9 +253,9 @@ def main(): insertafter = 'EOF' if insertafter not in (None, 'EOF'): - insertre = re.compile(insertafter) + insertre = re.compile(to_bytes(insertafter, errors='surrogate_or_strict')) elif insertbefore not in (None, 'BOF'): - insertre = re.compile(insertbefore) + insertre = re.compile(to_bytes(insertbefore, errors='surrogate_or_strict')) else: insertre = None |