mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #28238 from basepi/fix.schedule.present.28217
[2015.5] Fix schedule.present always diffing
This commit is contained in:
commit
1768014705
2 changed files with 7 additions and 1 deletions
|
@ -293,7 +293,7 @@ def build_schedule_item(name, **kwargs):
|
|||
schedule[name]['splay'] = kwargs['splay']
|
||||
|
||||
for item in ['range', 'when', 'once', 'once_fmt', 'cron', 'returner',
|
||||
'return_config']:
|
||||
'return_config', 'enabled']:
|
||||
if item in kwargs:
|
||||
schedule[name][item] = kwargs[item]
|
||||
|
||||
|
|
|
@ -185,6 +185,12 @@ def present(name,
|
|||
ret['comment'] = new_item['comment']
|
||||
return ret
|
||||
|
||||
# The schedule.list gives us an item that is guaranteed to have an
|
||||
# 'enabled' argument. Before comparing, add 'enabled' if it's not
|
||||
# available (assume True, like schedule.list does)
|
||||
if 'enabled' not in new_item:
|
||||
new_item['enabled'] = True
|
||||
|
||||
if new_item == current_schedule[name]:
|
||||
ret['comment'].append('Job {0} in correct state'.format(name))
|
||||
else:
|
||||
|
|
Loading…
Add table
Reference in a new issue