Skip to content

Commit

Permalink
return friendlier error when failing to make dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoca committed May 20, 2016
1 parent 5bb4ee0 commit 38cca53
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/ansible/utils/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

import os
from errno import EEXIST
from ansible.utils.unicode import to_bytes
from ansible.errors import AnsibleError
from ansible.utils.unicode import to_bytes, to_str

__all__ = ['unfrackpath']

Expand All @@ -42,4 +43,4 @@ def makedirs_safe(path, mode=None):
os.makedirs(path)
except OSError as e:
if e.errno != EEXIST:
raise
raise AnsibleError("Unable to create local directories(%s): %s" % (path, to_str(e)))

0 comments on commit 38cca53

Please sign in to comment.