Skip to content

Commit

Permalink
fix(saltcheck): update for cron instead of cron_settings
Browse files Browse the repository at this point in the history
  • Loading branch information
myii committed Oct 15, 2019
1 parent 8845b3c commit 26cfa4f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions cron/saltcheck-tests/config.tst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
# vim: ft=sls

{%- from "cron/saltcheck-tests/map.jinja" import cron_settings with context %}
{%- from "cron/saltcheck-tests/map.jinja" import cron with context %}

{%- if 'tasks' in cron_settings %}
{%- for task,task_options in cron_settings.tasks.items() %}
{%- if 'tasks' in cron %}
{%- for task,task_options in cron.tasks.items() %}

{%- if task_options.type == 'present' %}
validate_cron.{{ task }}_exists:
Expand Down
4 changes: 2 additions & 2 deletions cron/saltcheck-tests/install.tst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
# vim: ft=sls

{%- from "cron/saltcheck-tests/map.jinja" import cron_settings with context %}
{%- from "cron/saltcheck-tests/map.jinja" import cron with context %}

verify_cron.install:
module_and_function: pkg.version
args:
- {{ cron_settings.pkg }}
- {{ cron.pkg }}
assertion: assertNotEmpty
8 changes: 4 additions & 4 deletions cron/saltcheck-tests/service.tst
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# -*- coding: utf-8 -*-
# vim: ft=sls

{%- from "cron/saltcheck-tests/map.jinja" import cron_settings with context %}
{%- from "cron/saltcheck-tests/map.jinja" import cron with context %}

cron.service:
{%- if 'enabled' not in cron_settings or ( 'enabled' in cron_settings and cron_settings.enabled ) %}
{%- if 'enabled' not in cron or ( 'enabled' in cron and cron.enabled ) %}
service.running:
- name: {{ cron_settings.service }}
- name: {{ cron.service }}
- enable: True
{%- else %}
service.dead:
- name: {{ cron_settings.service }}
- name: {{ cron.service }}
- enable: False
{%- endif %}

0 comments on commit 26cfa4f

Please sign in to comment.