Merge pull request #1550 from bcoca/1549_lininfile_backup_bug

fixes #1549
This commit is contained in:
Michael DeHaan 2012-11-07 13:50:54 -08:00
commit 43410c46f9

View file

@ -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)