Merge pull request #24382 from basepi/grainscommandnotfound23342

[2015.5] Handle CommandExecutionError in grains commands, Fixes #23342
This commit is contained in:
Nicole Thomas 2015-06-04 06:44:03 -06:00
commit b3fa8fefcb

View file

@ -497,9 +497,16 @@ def _virtual(osdata):
cmd = '{0} {1}'.format(command, ' '.join(args))
ret = __salt__['cmd.run_all'](cmd)
try:
ret = __salt__['cmd.run_all'](cmd)
if ret['retcode'] > 0:
if ret['retcode'] > 0:
if salt.log.is_logging_configured():
if salt.utils.is_windows():
continue
failed_commands.add(command)
continue
except salt.exceptions.CommandExecutionError:
if salt.log.is_logging_configured():
if salt.utils.is_windows():
continue