mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Indicate success to returner modules [GH-1792]
This commit is contained in:
parent
0195b360a1
commit
05f5000c46
@ -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(
|
||||||
|
Loading…
Reference in New Issue
Block a user