fix case in which file is created and backup is requested but fails, not it just doesn't attempt to backup the missing file

Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>
reviewable/pr18780/r1
Brian Coca 12 years ago
parent 1151381ab1
commit 924dc5006c

@ -143,7 +143,7 @@ def present(module, dest, regexp, line, insertafter, create, backup):
changed = True
if changed:
if backup:
if backup and os.path.exists(dest):
module.backup_local(dest)
f = open(dest, 'wb')
f.writelines(lines)

Loading…
Cancel
Save