Merge pull request #43882 from kunal-bajpai/fix_couchbase_returner

Handle possible KeyError in couchbase.get_load
This commit is contained in:
Nicole Thomas 2017-10-03 15:01:26 -04:00 committed by GitHub
commit 820a542a8d

View File

@ -265,9 +265,12 @@ def get_load(jid):
except couchbase.exceptions.NotFoundError:
return {}
ret = jid_doc.value['load']
if 'minions' in jid_doc.value:
ret = {}
try:
ret = jid_doc.value['load']
ret['Minions'] = jid_doc.value['minions']
except KeyError as e:
log.error(e)
return ret