mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #41853 from vutny/fix-master-schedule-event
Fix master side scheduled jobs to return events
This commit is contained in:
commit
29b0acc3a2
1 changed files with 5 additions and 3 deletions
|
@ -888,9 +888,10 @@ class Schedule(object):
|
|||
ret['success'] = False
|
||||
ret['retcode'] = 254
|
||||
finally:
|
||||
# Only attempt to return data to the master
|
||||
# if the scheduled job is running on a minion.
|
||||
if '__role' in self.opts and self.opts['__role'] == 'minion':
|
||||
# Only attempt to return data to the master if the scheduled job is running
|
||||
# on a master itself or a minion.
|
||||
if '__role' in self.opts and self.opts['__role'] in ('master', 'minion'):
|
||||
# The 'return_job' option is enabled by default even if not set
|
||||
if 'return_job' in data and not data['return_job']:
|
||||
pass
|
||||
else:
|
||||
|
@ -918,6 +919,7 @@ class Schedule(object):
|
|||
log.exception("Unhandled exception firing event: {0}".format(exc))
|
||||
|
||||
log.debug('schedule.handle_func: Removing {0}'.format(proc_fn))
|
||||
|
||||
try:
|
||||
os.unlink(proc_fn)
|
||||
except OSError as exc:
|
||||
|
|
Loading…
Add table
Reference in a new issue