Merge pull request #41853 from vutny/fix-master-schedule-event

Fix master side scheduled jobs to return events
This commit is contained in:
garethgreenaway 2017-06-20 15:06:29 -07:00 committed by GitHub
commit 29b0acc3a2

View file

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