mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-01 16:23:10 +00:00
Merge pull request #5160 from JensRantil/fix-issue-5159
Fixes #5159 `file` module: Don't catch `SystemExit`
This commit is contained in:
@@ -234,8 +234,8 @@ def main():
|
||||
if module.check_mode:
|
||||
module.exit_json(changed=True)
|
||||
shutil.rmtree(path, ignore_errors=False)
|
||||
except:
|
||||
module.exit_json(msg="rmtree failed")
|
||||
except Exception, 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