mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Better error checking
This commit is contained in:
parent
252f7c7ea9
commit
6de2c2a50c
1 changed files with 5 additions and 2 deletions
|
@ -161,8 +161,11 @@ 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'))
|
||||
if form == 'grains' and __opts__.get('grains_cache') and os.path.isfile(os.path.join(__opts__['cachedir'], 'grains.cache.p')):
|
||||
try:
|
||||
os.remove(os.path.join(__opts__['cachedir'], 'grains.cache.p'))
|
||||
except OSError:
|
||||
log.error('Could not remove grains cache!')
|
||||
return ret
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue