Fix 'success' value for wheel commands

The ClearFuncs was assuming a 'success' of True 100% of the time for
wheel functions. This causes wheel funcs executed via salt-api (and
probably elsewhere) to incorrectly report the 'success' field when the
wheel function triggers a traceback (such as when required positional
arguments are not passed).

Resolves #38540
This commit is contained in:
Erik Johnson 2017-01-24 15:36:16 -06:00
parent 405d86a2ca
commit bd4474fa62

View file

@ -1805,9 +1805,9 @@ class ClearFuncs(object):
'user': token['name']}
try:
self.event.fire_event(data, tagify([jid, 'new'], 'wheel'))
ret = self.wheel_.call_func(fun, **clear_load)
data['return'] = ret
data['success'] = True
ret = self.wheel_.call_func(fun, full_return=True, **clear_load)
data['return'] = ret['return']
data['success'] = ret['success']
self.event.fire_event(data, tagify([jid, 'ret'], 'wheel'))
return {'tag': tag,
'data': data}