mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
Create dirs if not exists
This commit is contained in:
parent
1b9cb26f2e
commit
b99fd0ad64
@ -3321,6 +3321,15 @@ def _cache_id(minion_id, cache_file):
|
||||
'''
|
||||
Helper function, writes minion id to a cache file.
|
||||
'''
|
||||
path = os.path.dirname(cache_file)
|
||||
try:
|
||||
os.makedirs(path)
|
||||
except OSError:
|
||||
if os.path.isdir(path):
|
||||
pass
|
||||
else:
|
||||
raise
|
||||
|
||||
try:
|
||||
with salt.utils.files.fopen(cache_file, 'w') as idf:
|
||||
idf.write(minion_id)
|
||||
|
Loading…
Reference in New Issue
Block a user