Commit 5ea260f4 by Brian Coca

fix case in which file is created and backup is requested but fails, not it just…

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>
parent 75d3b774
......@@ -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)
......
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