cloud: makedirs: catch exception instead of checking in advance

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2018-03-03 04:24:12 +02:00
parent fb650a2cc3
commit d80b7da3ef
+4 -1
View File
@@ -125,8 +125,11 @@ class DataCloudBase(object):
def _makedirs(self, fname):
dname = os.path.dirname(fname)
if not os.path.exists(dname):
try:
os.makedirs(dname)
except OSError as e:
if e.errno != os.errno.EEXIST:
raise
def _pull_key(self, key, path):
""" Cloud-specific method of pulling keys """