mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
module(file): Fail instead of exit on exception
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user