Do not sync grains in grains.setval when using local mode

This commit is contained in:
Ryan Lane 2014-12-03 16:55:38 -08:00
parent 8a8d8883c6
commit 8e2a9f886c

View File

@ -237,8 +237,9 @@ def setvals(grains, destructive=False):
except (IOError, OSError):
msg = 'Unable to write to cache file {0}. Check permissions.'
log.error(msg.format(fn_))
# Sync the grains
__salt__['saltutil.sync_grains']()
if not __opts__.get('local', False):
# Sync the grains
__salt__['saltutil.sync_grains']()
# Return the grains we just set to confirm everything was OK
return new_grains