0
0
mirror of https://github.com/saltstack-formulas/cron-formula.git synced 2024-11-27 20:57:45 +01:00

style(saltcheck): merge absent & present into one if block

This commit is contained in:
Imran Iqbal 2019-10-15 19:53:37 +01:00
parent 6f2b32355a
commit 33f344c3ba
No known key found for this signature in database
GPG Key ID: 6D8629439D2B7819

View File

@ -6,7 +6,15 @@
{%- if 'tasks' in cron %}
{%- for task, task_options in cron.tasks.items() %}
{%- if task_options.type == 'present' %}
{%- if task_options.type == 'absent' %}
validate_cron.{{ task }}_absent:
module_and_function: cron.get_entry
args:
- {{ task_options.user|default('root') }}
- {{ task }}
assertion: assertFalse
{%- elif task_options.type == 'present' %}
validate_cron.{{ task }}_exists:
module_and_function: cron.get_entry
args:
@ -40,14 +48,5 @@ validate_cron.{{ task }}_commented:
{%- endif %}
{%- endif %}
{%- if task_options.type == 'absent' %}
validate_cron.{{ task }}_absent:
module_and_function: cron.get_entry
args:
- {{ task_options.user|default('root') }}
- {{ task }}
assertion: assertFalse
{%- endif %}
{%- endfor %}
{%- endif %}