Commit 88966e65 by James Cammarata

Use AnsibleError instead of exit for errors in utils

parent a8984a6b
...@@ -220,9 +220,9 @@ def prepare_writeable_dir(tree,mode=0777): ...@@ -220,9 +220,9 @@ def prepare_writeable_dir(tree,mode=0777):
try: try:
os.makedirs(tree, mode) os.makedirs(tree, mode)
except (IOError, OSError), e: except (IOError, OSError), e:
exit("Could not make dir %s: %s" % (tree, e)) raise errors.AnsibleError("Could not make dir %s: %s" % (tree, e))
if not os.access(tree, os.W_OK): if not os.access(tree, os.W_OK):
exit("Cannot write to path %s" % tree) raise errors.AnsibleError("Cannot write to path %s" % tree)
return tree return tree
def path_dwim(basedir, given): def path_dwim(basedir, given):
......
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