blockinfile - Remove unused code for Ansible 1.x. (#75040)
This commit is contained in:
parent
5e65d9834b
commit
ce17498ec5
2
changelogs/fragments/blockinfile-unused-code.yml
Normal file
2
changelogs/fragments/blockinfile-unused-code.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
minor_changes:
|
||||
- blockinfile - Remove unused code for Ansible 1.x.
|
|
@ -265,9 +265,6 @@ def main():
|
|||
marker0 = re.sub(b(r'{mark}'), b(params['marker_begin']), marker) + b(os.linesep)
|
||||
marker1 = re.sub(b(r'{mark}'), b(params['marker_end']), marker) + b(os.linesep)
|
||||
if present and block:
|
||||
# Escape sequences like '\n' need to be handled in Ansible 1.x
|
||||
if module.ansible_version.startswith('1.'):
|
||||
block = re.sub('', block, '')
|
||||
if not block.endswith(b(os.linesep)):
|
||||
block += b(os.linesep)
|
||||
blocklines = [marker0] + block.splitlines(True) + [marker1]
|
||||
|
|
Loading…
Reference in a new issue