Commit 43410c46 by Michael DeHaan

Merge pull request #1550 from bcoca/1549_lininfile_backup_bug

fixes #1549
parents 75d3b774 5ea260f4
...@@ -143,7 +143,7 @@ def present(module, dest, regexp, line, insertafter, create, backup): ...@@ -143,7 +143,7 @@ def present(module, dest, regexp, line, insertafter, create, backup):
changed = True changed = True
if changed: if changed:
if backup: if backup and os.path.exists(dest):
module.backup_local(dest) module.backup_local(dest)
f = open(dest, 'wb') f = open(dest, 'wb')
f.writelines(lines) f.writelines(lines)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment