diff options
author | YAEGASHI Takeshi <yaegashi@users.noreply.github.com> | 2016-10-24 23:30:46 +0900 |
---|---|---|
committer | René Moser <mail@renemoser.net> | 2016-10-24 16:30:46 +0200 |
commit | 8985a1fbd9a22ca89e07f7c4dd75512d3a326d1d (patch) | |
tree | c689a18e83420858568b89bdf55a5da2c4739872 /files | |
parent | 8ffe314ea55798c3af8b8a2e74782c190a19ef55 (diff) | |
download | ansible-modules-extras-8985a1fbd9a22ca89e07f7c4dd75512d3a326d1d.tar.gz |
blockinfile: Add a newline at EOF when the file is newly created (#3174)
Ref: #2687
Diffstat (limited to 'files')
-rwxr-xr-x | files/blockinfile.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/files/blockinfile.py b/files/blockinfile.py index 8ba76181..30fe77d9 100755 --- a/files/blockinfile.py +++ b/files/blockinfile.py @@ -285,7 +285,7 @@ def main(): if lines: result = '\n'.join(lines) - if original and original.endswith('\n'): + if original is None or original.endswith('\n'): result += '\n' else: result = '' |