mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Fix for issue 32523 (#32672)
This commit is contained in:
parent
21081b1e88
commit
aaa03bc6e6
@ -556,12 +556,12 @@ def grains(opts, force_refresh=False, proxy=None):
|
||||
print __grains__['id']
|
||||
'''
|
||||
# if we hae no grains, lets try loading from disk (TODO: move to decorator?)
|
||||
cfn = os.path.join(
|
||||
opts['cachedir'],
|
||||
'grains.cache.p'
|
||||
)
|
||||
if not force_refresh:
|
||||
if opts.get('grains_cache', False):
|
||||
cfn = os.path.join(
|
||||
opts['cachedir'],
|
||||
'grains.cache.p'
|
||||
)
|
||||
if os.path.isfile(cfn):
|
||||
grains_cache_age = int(time.time() - os.path.getmtime(cfn))
|
||||
if opts.get('grains_cache_expiration', 300) >= grains_cache_age and not \
|
||||
|
Loading…
Reference in New Issue
Block a user