Make the module functions able to throw exceptions

This commit is contained in:
Thomas S Hatch 2011-03-16 11:41:16 -06:00
parent b26313de20
commit 6082e850e1

View file

@ -141,10 +141,10 @@ class Minion(object):
if not self._glob_match(data['tgt']):
return ret
if self.functions.has_key(data['fun']):
try:
ret['return'] = self.functions[data['fun']](*data['arg'])
else:
ret['return'] = Exception('Failed to find the specified module')
except Exception as exc:
ret['return'] = exc
ret['jid'] = data['jid']
return ret