Clean grains cache on grains sync

Closes #19853
This commit is contained in:
Mike Place 2015-09-15 11:33:01 -06:00
parent c78d833540
commit 252f7c7ea9

View file

@ -161,6 +161,8 @@ def _sync(form, saltenv=None):
mod_file = os.path.join(__opts__['cachedir'], 'module_refresh')
with salt.utils.fopen(mod_file, 'a+') as ofile:
ofile.write('')
if form == 'grains' and __opts__.get('grains_cache'):
os.remove(os.path.join(__opts__['cachedir'], 'grains.cache.p'))
return ret