Fix exception casting bug, pass id to dynamic returners

This commit is contained in:
Thomas S Hatch 2011-04-18 22:57:14 -06:00
parent cf7b0e8499
commit 149c7fae92

View File

@ -283,11 +283,12 @@ class Minion(object):
ret['return'] = exc
ret['jid'] = data['jid']
if data['ret']:
ret['id'] = self.opts['id']
try:
self.returners[data['ret']](ret)
except Exception as exc:
self.opts['logger'].error('The return failed for job'\
+ data['jid'] + ' ' + exc)
+ data['jid'] + ' ' + str(exc))
else:
self._return_pub(ret)
@ -313,11 +314,12 @@ class Minion(object):
ret['return'][data['fun'][ind]] = exc
ret['jid'] = data['jid']
if data['ret']:
ret['id'] = self.opts['id']
try:
self.returners[data['ret']](ret)
except Exception as exc:
self.opts['logger'].error('The return failed for job'\
+ data['jid'] + ' ' + exc)
+ data['jid'] + ' ' + str(exc))
else:
self._return_pub(ret)