summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authordougluce <doug@github.con.com>2016-05-24 22:54:07 -0700
committerRené Moser <mail@renemoser.net>2016-05-25 07:54:07 +0200
commitb6b04795c3fdeccf17eb0556d3f26855755ece2a (patch)
tree198d60e77dc0e0767102c9a5de79281cfebbbf85 /files
parentd1a4f703ce493db6e0dfa8b37bb225ca7f53651c (diff)
downloadansible-modules-extras-b6b04795c3fdeccf17eb0556d3f26855755ece2a.tar.gz
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
Diffstat (limited to 'files')
-rwxr-xr-x[-rw-r--r--]files/blockinfile.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/files/blockinfile.py b/files/blockinfile.py
index 81834dfd..da67e2d4 100644..100755
--- a/files/blockinfile.py
+++ b/files/blockinfile.py
@@ -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 = ''