module(file): Fail instead of exit on exception

pull/5160/head
Jens Rantil 11 years ago
parent f4aa808b8d
commit 1b6019f6e0

@ -235,7 +235,7 @@ def main():
module.exit_json(changed=True)
shutil.rmtree(path, ignore_errors=False)
except Exception, e:
module.exit_json(msg="rmtree failed: %s" % str(e))
module.fail_json(msg="rmtree failed: %s" % str(e))
else:
if module.check_mode:
module.exit_json(changed=True)

Loading…
Cancel
Save