From 33f344c3bae7a04dced88eef53f3d13ee01523f8 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Tue, 15 Oct 2019 19:53:37 +0100 Subject: [PATCH] style(saltcheck): merge `absent` & `present` into one `if` block --- cron/saltcheck-tests/config.tst | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/cron/saltcheck-tests/config.tst b/cron/saltcheck-tests/config.tst index ec2c2ce..5d6b8e1 100644 --- a/cron/saltcheck-tests/config.tst +++ b/cron/saltcheck-tests/config.tst @@ -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 %}