Merge pull request #24926 from rallytime/bp-22263

Back-port #22263 to 2015.5
This commit is contained in:
Mike Place 2015-06-24 09:09:40 -06:00
commit 087ee09f46
2 changed files with 4 additions and 2 deletions

View file

@ -228,7 +228,8 @@ def get_load(jid):
Return the load data that marks a specified jid
'''
jid_dir = _jid_dir(jid)
if not os.path.exists(jid_dir):
load_fn = os.path.join(jid_dir, LOAD_P)
if not os.path.exists(jid_dir) or not os.path.exists(load_fn):
return {}
serial = salt.payload.Serial(__opts__)

View file

@ -67,6 +67,7 @@ def store_job(opts, load, event=None, mminion=None):
# otherwise, write to the master cache
savefstr = '{0}.save_load'.format(job_cache)
getfstr = '{0}.get_load'.format(job_cache)
fstr = '{0}.returner'.format(job_cache)
if 'fun' not in load and load.get('return', {}):
ret_ = load.get('return', {})
@ -75,7 +76,7 @@ def store_job(opts, load, event=None, mminion=None):
if 'user' in ret_:
load.update({'user': ret_['user']})
try:
if 'jid' in load:
if 'jid' in load and not mminion.returners[getfstr](load.get('jid', '')):
mminion.returners[savefstr](load['jid'], load)
mminion.returners[fstr](load)
except KeyError: