summaryrefslogtreecommitdiff
path: root/lib/ansible/utils/path.py
diff options
context:
space:
mode:
authorBrian Coca <brian.coca+git@gmail.com>2015-06-02 13:01:02 -0400
committerBrian Coca <brian.coca+git@gmail.com>2015-06-02 13:01:59 -0400
commitba02e5e3bf7d03a8c64713cebb5f851b2f5396ce (patch)
tree94ba20684bf66f07a604151cac73362311a95a7b /lib/ansible/utils/path.py
parent2590df6df1e3e4317f3247185be2940d95bd2c7b (diff)
downloadansible-ba02e5e3bf7d03a8c64713cebb5f851b2f5396ce.tar.gz
minor adjustments as per code review
Diffstat (limited to 'lib/ansible/utils/path.py')
-rw-r--r--lib/ansible/utils/path.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ansible/utils/path.py b/lib/ansible/utils/path.py
index 534226984b..ac5160402b 100644
--- a/lib/ansible/utils/path.py
+++ b/lib/ansible/utils/path.py
@@ -20,6 +20,7 @@ __metaclass__ = type
import os
import stat
from time import sleep
+from errno import EEXIST
__all__ = ['is_executable', 'unfrackpath']
@@ -38,10 +39,9 @@ def unfrackpath(path):
def makedirs_safe(path, mode=None):
'''Safe way to create dirs in muliprocess/thread environments'''
- while not os.path.exists(path):
+ if not os.path.exists(path):
try:
os.makedirs(path, mode)
except OSError, e:
- if e.errno != 17:
+ if e.errno != EEXIST:
raise
- sleep(1)