mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-01 19:02:49 +00:00
avoid failing when mode is none
This commit is contained in:
@@ -41,7 +41,10 @@ def makedirs_safe(path, mode=None):
|
||||
'''Safe way to create dirs in muliprocess/thread environments'''
|
||||
if not os.path.exists(path):
|
||||
try:
|
||||
os.makedirs(path, mode)
|
||||
if mode:
|
||||
os.makedirs(path, mode)
|
||||
else:
|
||||
os.makedirs(path)
|
||||
except OSError, e:
|
||||
if e.errno != EEXIST:
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user