Merge pull request #37502 from cachedout/issue_37444

Log proper message on returners that cannot be loaded
This commit is contained in:
Mike Place 2016-11-07 22:32:45 +13:00 committed by GitHub
commit 4b6f1ab1c4

View File

@ -1458,9 +1458,13 @@ class Minion(MinionBase):
ret['id'] = opts['id'] ret['id'] = opts['id']
for returner in set(data['ret'].split(',')): for returner in set(data['ret'].split(',')):
try: try:
minion_instance.returners['{0}.returner'.format( returner_str = '{0}.returner'.format(returner)
returner if returner_str in minion_instance.returners:
)](ret) minion_instance.returners[returner_str](ret)
else:
returner_err = minion_instance.returners.missing_fun_string(returner_str)
log.error('Returner {0} could not be loaded: {1}'.format(
returner_str, returner_err))
except Exception as exc: except Exception as exc:
log.error( log.error(
'The return failed for job {0} {1}'.format( 'The return failed for job {0} {1}'.format(