Fix grains cache

Prior to this, custom grains were not being cached at all.
This commit is contained in:
Mike Place 2016-01-26 16:37:55 -06:00
parent 30e03a8b0c
commit 52716694f5

View File

@ -645,6 +645,7 @@ def grains(opts, force_refresh=False, proxy=None):
continue
grains_data.update(ret)
grains_data.update(opts['grains'])
# Write cache if enabled
if opts.get('grains_cache', False):
cumask = os.umask(0o77)
@ -664,7 +665,6 @@ def grains(opts, force_refresh=False, proxy=None):
log.error(msg.format(cfn))
os.umask(cumask)
grains_data.update(opts['grains'])
return grains_data