From 88966e6558fe53fdf5c30910e9bc154db2d18081 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Sun, 25 Aug 2013 11:46:45 -0500 Subject: [PATCH] Use AnsibleError instead of exit for errors in utils --- lib/ansible/utils/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/utils/__init__.py b/lib/ansible/utils/__init__.py index 39a954f0caf..a7305b3ded5 100644 --- a/lib/ansible/utils/__init__.py +++ b/lib/ansible/utils/__init__.py @@ -220,9 +220,9 @@ def prepare_writeable_dir(tree,mode=0777): try: os.makedirs(tree, mode) 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): - exit("Cannot write to path %s" % tree) + raise errors.AnsibleError("Cannot write to path %s" % tree) return tree def path_dwim(basedir, given):