Backport #33021 manually to 2015.5 (#33044)

This commit is contained in:
Thomas S Hatch 2016-05-04 14:34:29 -06:00 committed by Nicole Thomas
parent f00b5f91b3
commit 1d7892421e
2 changed files with 8 additions and 7 deletions

View File

@ -2319,7 +2319,7 @@ class Syndic(Minion):
if 'jid' not in event['data']:
# Not a job return
continue
jdict = self.jids.setdefault(event['tag'], {})
jdict = self.jids.setdefault(event['data']['jid'], {})
if not jdict:
jdict['__fun__'] = event['data'].get('fun')
jdict['__jid__'] = event['data']['jid']

View File

@ -122,12 +122,13 @@ def prep_jid(nocache=False, passed_jid=None, recurse_count=0):
# Make sure we create the jid dir, otherwise someone else is using it,
# meaning we need a new jid.
try:
os.makedirs(jid_dir_)
except OSError:
time.sleep(0.1)
if passed_jid is None:
return prep_jid(nocache=nocache, recurse_count=recurse_count+1)
if not os.path.isdir(jid_dir_):
try:
os.makedirs(jid_dir_)
except OSError:
time.sleep(0.1)
if passed_jid is None:
return prep_jid(nocache=nocache, recurse_count=recurse_count+1)
try:
with salt.utils.fopen(os.path.join(jid_dir_, 'jid'), 'wb+') as fn_: