1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02: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:
dougluce 2016-05-24 22:54:07 -07:00 committed by Matt Clay
parent f096cd6322
commit aaaf37ae41

2
lib/ansible/modules/extras/files/blockinfile.py Normal file → Executable file
View file

@ -281,7 +281,7 @@ def main():
if lines:
result = '\n'.join(lines)
if original.endswith('\n'):
if original and original.endswith('\n'):
result += '\n'
else:
result = ''