Skip to content

Commit

Permalink
Backport saltstack#33021 manually to 2015.5
Browse files Browse the repository at this point in the history
  • Loading branch information
thatch45 committed May 4, 2016
1 parent f00b5f9 commit 9670af6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion salt/minion.py
Expand Up @@ -2319,7 +2319,7 @@ def _process_event_socket(self):
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']
Expand Down
13 changes: 7 additions & 6 deletions salt/returners/local_cache.py
Expand Up @@ -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_:
Expand Down

0 comments on commit 9670af6

Please sign in to comment.