module(file): Fail instead of exit on exception
This commit is contained in:
parent
4262e76aec
commit
38d0df65d8
1 changed files with 1 additions and 1 deletions
|
@ -235,7 +235,7 @@ def main():
|
||||||
module.exit_json(changed=True)
|
module.exit_json(changed=True)
|
||||||
shutil.rmtree(path, ignore_errors=False)
|
shutil.rmtree(path, ignore_errors=False)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
module.exit_json(msg="rmtree failed: %s" % str(e))
|
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)
|
||||||
|
|
Loading…
Reference in a new issue