diff --git a/cron/config/file.sls b/cron/config/file.sls index c5afe32..66d5e8f 100644 --- a/cron/config/file.sls +++ b/cron/config/file.sls @@ -20,7 +20,7 @@ cron.{{ task }}: - {{ section }}: '{{ task_options.get(section) }}' {%- endif %} {%- endfor %} - {%- if 'commented' in task_options and task_options.commented %} + {%- if task_options.commented|d(False) %} - commented: True {%- endif %} {%- endfor %} diff --git a/cron/saltcheck-tests/config.tst b/cron/saltcheck-tests/config.tst index d928e9d..21f225d 100644 --- a/cron/saltcheck-tests/config.tst +++ b/cron/saltcheck-tests/config.tst @@ -44,15 +44,17 @@ validate_cron.{{ task }}_{{ section }}: {%- endif %} {%- endfor %} -{%- if 'commented' in task_options and task_options.commented %} +{%- set assertion = 'assertFalse' %} +{%- if task_options.commented|d(False) %} +{%- set assertion = 'assertTrue' %} +{%- endif %} validate_cron.{{ task }}_commented: module_and_function: cron.get_entry args: - {{ task_options.user|d('root') }} - {{ task }} - assertion: assertTrue + assertion: {{ assertion }} assertion_section: commented -{%- endif %} {%- endif %} {%- endfor %}