mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Properly save minion list in local_cache for ssh jobs
This commit is contained in:
parent
4b1bf7d5e2
commit
bd8487b3b9
@ -520,6 +520,9 @@ class SSH(object):
|
||||
|
||||
# save load to the master job cache
|
||||
try:
|
||||
if self.opts['master_job_cache'] == 'local_cache':
|
||||
self.returners['{0}.save_load'.format(self.opts['master_job_cache'])](jid, job_load, minions=self.targets.keys())
|
||||
else:
|
||||
self.returners['{0}.save_load'.format(self.opts['master_job_cache'])](jid, job_load)
|
||||
except Exception as exc:
|
||||
log.error('Could not save load with returner {0}: {1}'.format(self.opts['master_job_cache'], exc))
|
||||
|
@ -173,9 +173,13 @@ def returner(load):
|
||||
)
|
||||
|
||||
|
||||
def save_load(jid, clear_load):
|
||||
def save_load(jid, clear_load, minions=None):
|
||||
'''
|
||||
Save the load to the specified jid
|
||||
|
||||
minions argument is to provide a pre-computed list of matched minions for
|
||||
the job, for cases when this function can't compute that list itself (such
|
||||
as for salt-ssh)
|
||||
'''
|
||||
jid_dir = _jid_dir(jid)
|
||||
|
||||
@ -202,6 +206,7 @@ def save_load(jid, clear_load):
|
||||
|
||||
# if you have a tgt, save that for the UI etc
|
||||
if 'tgt' in clear_load:
|
||||
if minions is None:
|
||||
ckminions = salt.utils.minions.CkMinions(__opts__)
|
||||
# Retrieve the minions list
|
||||
minions = ckminions.check_minions(
|
||||
|
Loading…
Reference in New Issue
Block a user