mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Update a job's minion list to include minion lists forwarded by syndic
This allows the job cache to include minions matched by lower-level masters for a given job.
This commit is contained in:
parent
504f7df460
commit
f731dc5d32
1 changed files with 21 additions and 0 deletions
|
@ -1186,6 +1186,27 @@ class AESFuncs(object):
|
|||
log.error('Received minion error from [{minion}]: '
|
||||
'{data}'.format(minion=load['id'],
|
||||
data=load['data']['message']))
|
||||
for event in load.get('events', []):
|
||||
event_data = event.get('data', {})
|
||||
if 'minions' in event_data:
|
||||
jid = event_data.get('jid')
|
||||
if not jid:
|
||||
# Should not happen but if it ever does we definitely want
|
||||
# to know about it.
|
||||
log.warning('No jid in event: %s', event_data)
|
||||
else:
|
||||
minions = event_data['minions']
|
||||
try:
|
||||
salt.utils.job.store_minions(
|
||||
self.opts,
|
||||
jid,
|
||||
minions,
|
||||
mminion=self.mminion)
|
||||
except (KeyError, salt.exceptions.SaltCacheError) as exc:
|
||||
log.error(
|
||||
'Could not add minion(s) {0} for job {1}: {2}'
|
||||
.format(minions, jid, exc)
|
||||
)
|
||||
|
||||
def _return(self, load):
|
||||
'''
|
||||
|
|
Loading…
Add table
Reference in a new issue