Prevents crash when there is no job entry

Seems like in rare race conditions it might happen that there is no job
entry. This prevents Salt from crashing at that point.
This commit is contained in:
Jochen Breuer 2019-02-13 16:50:34 +01:00
parent fdb13a3a91
commit d263410e46
No known key found for this signature in database
GPG key ID: 29ACE79F4D5EEE69

View file

@ -77,6 +77,9 @@ def _walk_through(job_dir):
except Exception:
log.exception('Failed to deserialize %s', load_path)
continue
if not job:
log.error('Deserialization of job succeded but there is no data in %s', load_path)
continue
jid = job['jid']
yield jid, job, t_path, final