mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-26 16:36:29 +00:00
Use AnsibleError instead of exit for errors in utils
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user