mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Add update_endtime functionality to salt.utils.job.store_job
This commit is contained in:
parent
9ed805d631
commit
b3134d88ac
@ -760,7 +760,7 @@ class RemoteFuncs(object):
|
||||
return
|
||||
|
||||
fstr = '{0}.update_endtime'.format(self.opts['master_job_cache'])
|
||||
if (self.opts.get['job_cache_store_endtime']
|
||||
if (self.opts.get('job_cache_store_endtime')
|
||||
and fstr in self.mminion.returners):
|
||||
self.mminion.returners[fstr](load['jid'], endtime)
|
||||
|
||||
|
@ -18,6 +18,8 @@ def store_job(opts, load, event=None, mminion=None):
|
||||
'''
|
||||
Store job information using the configured master_job_cache
|
||||
'''
|
||||
# Generate EndTime
|
||||
endtime = salt.utils.jid.jid_to_time(salt.utils.jid.gen_jid())
|
||||
# If the return data is invalid, just ignore it
|
||||
if any(key not in load for key in ('return', 'jid', 'id')):
|
||||
return False
|
||||
@ -84,6 +86,12 @@ def store_job(opts, load, event=None, mminion=None):
|
||||
if 'jid' in load and 'get_load' in mminion.returners and not mminion.returners[getfstr](load.get('jid', '')):
|
||||
mminion.returners[savefstr](load['jid'], load)
|
||||
mminion.returners[fstr](load)
|
||||
|
||||
updateetfstr = '{0}.update_endtime'.format(job_cache)
|
||||
if (opts.get('job_cache_store_endtime')
|
||||
and updateetfstr in mminion.returners):
|
||||
mminion.returners[updateetfstr](load['jid'], endtime)
|
||||
|
||||
except KeyError:
|
||||
emsg = "Returner '{0}' does not support function returner".format(job_cache)
|
||||
log.error(emsg)
|
||||
|
Loading…
Reference in New Issue
Block a user