Give user a reason a minion did not return

Gives the user who selects a verbose output a best guess on why the
minion did not return a response.
This commit is contained in:
Mike Place 2014-08-20 16:13:18 -06:00
parent 7ea0328fef
commit 1a2ef652b4

View File

@ -1199,13 +1199,19 @@ class LocalClient(object):
or tgt_type in ('glob', 'pcre', 'list'):
if len(found) < len(minions):
fail = sorted(list(minions.difference(found)))
for minion in fail:
yield({
minion: {
'out': 'no_return',
'ret': 'Minion did not return'
}
})
# May incur heavy disk access
connected_minions = salt.utils.minions.CkMinions(self.opts).connected_ids()
for failed in fail:
if connected_minions and failed not in connected_minions:
yield {failed: {'out': 'no_return',
'ret': 'Minion did not return. [Not connected]'}}
else:
yield({
failed: {
'out': 'no_return',
'ret': 'Minion did not return. [No response]'
}
})
break
if time.time() > timeout_at:
# The timeout has been reached, check the jid to see if the