mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fixed display of errors
This commit is contained in:
parent
14a39f914e
commit
a2b1259671
1 changed files with 13 additions and 8 deletions
|
@ -638,7 +638,6 @@ def runner(name, **kwargs):
|
|||
salt.runner:
|
||||
- name: manage.up
|
||||
'''
|
||||
ret = {'name': name, 'result': False, 'changes': {}, 'comment': ''}
|
||||
try:
|
||||
jid = __orchestration_jid__
|
||||
except NameError:
|
||||
|
@ -652,20 +651,26 @@ def runner(name, **kwargs):
|
|||
full_return=True,
|
||||
**kwargs)
|
||||
|
||||
runner_return = out.get('return')
|
||||
if 'success' in out and not out['success']:
|
||||
ret['result'] = False
|
||||
ret = {
|
||||
'name': name,
|
||||
'result': False,
|
||||
'changes': {},
|
||||
'comment': runner_return if runner_return else "Runner function '{0}' failed without comment.".format(name)
|
||||
}
|
||||
else:
|
||||
ret['result'] = True
|
||||
ret['comment'] = "Runner function '{0}' executed.".format(name)
|
||||
ret = {
|
||||
'name': name,
|
||||
'result': True,
|
||||
'changes': runner_return if runner_return else {},
|
||||
'comment': "Runner function '{0}' executed.".format(name)
|
||||
}
|
||||
|
||||
ret['__orchestration__'] = True
|
||||
if 'jid' in out:
|
||||
ret['__jid__'] = out['jid']
|
||||
|
||||
runner_return = out.get('return')
|
||||
if runner_return:
|
||||
ret['changes'] = runner_return
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue