mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Don't bomb if original didn't exist (#2295)
If we don't have an existing file, original ends up as None. Bug introduced in 70fa125
This commit is contained in:
2
lib/ansible/modules/extras/files/blockinfile.py
Normal file → Executable file
2
lib/ansible/modules/extras/files/blockinfile.py
Normal file → Executable file
@@ -281,7 +281,7 @@ def main():
|
|||||||
|
|
||||||
if lines:
|
if lines:
|
||||||
result = '\n'.join(lines)
|
result = '\n'.join(lines)
|
||||||
if original.endswith('\n'):
|
if original and original.endswith('\n'):
|
||||||
result += '\n'
|
result += '\n'
|
||||||
else:
|
else:
|
||||||
result = ''
|
result = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user