Commit 516d9287 by jctanner Committed by James Tanner

Merge pull request #5160 from JensRantil/fix-issue-5159

Fixes #5159 `file` module: Don't catch `SystemExit`
parent 00fb6257
...@@ -234,8 +234,8 @@ def main(): ...@@ -234,8 +234,8 @@ def main():
if module.check_mode: if module.check_mode:
module.exit_json(changed=True) module.exit_json(changed=True)
shutil.rmtree(path, ignore_errors=False) shutil.rmtree(path, ignore_errors=False)
except: except Exception, e:
module.exit_json(msg="rmtree failed") module.fail_json(msg="rmtree failed: %s" % str(e))
else: else:
if module.check_mode: if module.check_mode:
module.exit_json(changed=True) module.exit_json(changed=True)
......
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