mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #26553 from rallytime/bp-26548
Back-port #26548 to 2015.5
This commit is contained in:
commit
5a32664efd
1 changed files with 4 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue