fix 35420, add run_on_start in build_schedule_item, remove redundancy of enabled

This commit is contained in:
Hengyang Hu 2016-08-18 23:11:55 -07:00
parent 4f0b3be20c
commit 2d3a882cc2
2 changed files with 5 additions and 6 deletions

View file

@ -359,15 +359,10 @@ def build_schedule_item(name, **kwargs):
schedule[name]['splay'] = kwargs['splay']
for item in ['range', 'when', 'once', 'once_fmt', 'cron', 'returner',
'return_config', 'return_kwargs', 'until', 'enabled']:
'return_config', 'return_kwargs', 'until', 'run_on_start']:
if item in kwargs:
schedule[name][item] = kwargs[item]
# if enabled is not included in the job,
# assume job is enabled.
if 'enabled' not in kwargs:
schedule[name]['enabled'] = True
return schedule[name]

View file

@ -117,6 +117,10 @@ def present(name,
using the crontab format.
Requires python-croniter.
run_on_start
Whether the job will run when Salt minion start. Value should be
a boolean.
function
The function that should be executed by the scheduled job.