Merge pull request #22945 from garethgreenaway/22571_2014_7_schedule_pillar_refresh_seconds_exceptions

Fixes to scheduler
This commit is contained in:
Mike Place 2015-04-22 10:25:00 -06:00
commit de339bef0a

View file

@ -639,6 +639,21 @@ class Schedule(object):
self.loop_interval = seconds
run = False
if 'splay' in data:
if 'when' in data:
log.error('Unable to use "splay" with "when" option at this time. Ignoring.')
elif 'cron' in data:
log.error('Unable to use "splay" with "cron" option at this time. Ignoring.')
else:
if '_seconds' not in data:
log.debug('The _seconds parameter is missing, '
'most likely the first run or the schedule '
'has been refreshed refresh.')
if 'seconds' in data:
data['_seconds'] = data['seconds']
else:
data['_seconds'] = 0
if job in self.intervals:
if 'when' in data:
if seconds == 0:
@ -652,18 +667,6 @@ class Schedule(object):
if now - self.intervals[job] >= seconds:
run = True
else:
if 'splay' in data:
if 'when' in data:
log.error('Unable to use "splay" with "when" option at this time. Ignoring.')
elif 'cron' in data:
log.error('Unable to use "splay" with "cron" option at this time. Ignoring.')
else:
if 'seconds' in data:
log.debug('breakage here')
data['_seconds'] = data['seconds']
else:
data['_seconds'] = 0
if 'when' in data:
if seconds == 0:
if data['_when_run']: