Fixed display of errors

This commit is contained in:
benediktwerner 2016-11-02 01:27:50 +01:00 committed by Elias Wulcan
parent 14a39f914e
commit a2b1259671

View file

@ -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