Use AnsibleError instead of exit for errors in utils

pull/3946/merge
James Cammarata 11 years ago
parent a8984a6b2b
commit 88966e6558

@ -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):

Loading…
Cancel
Save