mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Catch OSError during cache directories creation, fixes #19249
This commit is contained in:
parent
1ac8287588
commit
ec2b2c3e40
@ -230,7 +230,10 @@ def file_hash(load, fnd):
|
||||
cache_dir = os.path.dirname(cache_path)
|
||||
# make cache directory if it doesn't exist
|
||||
if not os.path.exists(cache_dir):
|
||||
os.makedirs(cache_dir)
|
||||
try:
|
||||
os.makedirs(cache_dir)
|
||||
except OSError:
|
||||
pass
|
||||
# save the cache object "hash:mtime"
|
||||
cache_object = '{0}:{1}'.format(ret['hsum'], os.path.getmtime(path))
|
||||
with salt.utils.flopen(cache_path, 'w') as fp_:
|
||||
|
Loading…
Reference in New Issue
Block a user