mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Update return data before calling returners
This commit is contained in:
parent
61fad97286
commit
1cc86592ed
@ -849,6 +849,12 @@ class Schedule(object):
|
|||||||
|
|
||||||
ret['return'] = self.functions[func](*args, **kwargs)
|
ret['return'] = self.functions[func](*args, **kwargs)
|
||||||
|
|
||||||
|
# runners do not provide retcode
|
||||||
|
if 'retcode' in self.functions.pack['__context__']:
|
||||||
|
ret['retcode'] = self.functions.pack['__context__']['retcode']
|
||||||
|
|
||||||
|
ret['success'] = True
|
||||||
|
|
||||||
data_returner = data.get('returner', None)
|
data_returner = data.get('returner', None)
|
||||||
if data_returner or self.schedule_returner:
|
if data_returner or self.schedule_returner:
|
||||||
if 'return_config' in data:
|
if 'return_config' in data:
|
||||||
@ -865,7 +871,6 @@ class Schedule(object):
|
|||||||
for returner in OrderedDict.fromkeys(rets):
|
for returner in OrderedDict.fromkeys(rets):
|
||||||
ret_str = '{0}.returner'.format(returner)
|
ret_str = '{0}.returner'.format(returner)
|
||||||
if ret_str in self.returners:
|
if ret_str in self.returners:
|
||||||
ret['success'] = True
|
|
||||||
self.returners[ret_str](ret)
|
self.returners[ret_str](ret)
|
||||||
else:
|
else:
|
||||||
log.info(
|
log.info(
|
||||||
@ -874,11 +879,6 @@ class Schedule(object):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
# runners do not provide retcode
|
|
||||||
if 'retcode' in self.functions.pack['__context__']:
|
|
||||||
ret['retcode'] = self.functions.pack['__context__']['retcode']
|
|
||||||
|
|
||||||
ret['success'] = True
|
|
||||||
except Exception:
|
except Exception:
|
||||||
log.exception("Unhandled exception running {0}".format(ret['fun']))
|
log.exception("Unhandled exception running {0}".format(ret['fun']))
|
||||||
# Although catch-all exception handlers are bad, the exception here
|
# Although catch-all exception handlers are bad, the exception here
|
||||||
|
Loading…
Reference in New Issue
Block a user