Indicate success to returner modules [GH-1792]

This commit is contained in:
Evan Borgstrom 2012-08-08 17:27:06 -04:00
parent 0195b360a1
commit 05f5000c46

View File

@ -275,10 +275,12 @@ class Minion(object):
function_name = data['fun'] function_name = data['fun']
if function_name in self.functions: if function_name in self.functions:
ret['success'] = False
try: try:
func = self.functions[data['fun']] func = self.functions[data['fun']]
args, kw = detect_kwargs(func, data['arg'], data) args, kw = detect_kwargs(func, data['arg'], data)
ret['return'] = func(*args, **kw) ret['return'] = func(*args, **kw)
ret['success'] = True
except CommandNotFoundError as exc: except CommandNotFoundError as exc:
msg = 'Command required for \'{0}\' not found: {1}' msg = 'Command required for \'{0}\' not found: {1}'
log.debug(msg.format(function_name, str(exc))) log.debug(msg.format(function_name, str(exc)))
@ -334,10 +336,12 @@ class Minion(object):
except Exception: except Exception:
pass pass
ret['success'][data['fun'][ind]] = False
try: try:
func = self.functions[data['fun'][ind]] func = self.functions[data['fun'][ind]]
args, kw = detect_kwargs(func, data['arg'][ind], data) args, kw = detect_kwargs(func, data['arg'][ind], data)
ret['return'][data['fun'][ind]] = func(*args, **kw) ret['return'][data['fun'][ind]] = func(*args, **kw)
ret['success'][data['fun'][ind]] = True
except Exception as exc: except Exception as exc:
trb = traceback.format_exc() trb = traceback.format_exc()
log.warning( log.warning(