mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
win_scheduled_task: add deprecation warning for repetition format (#45468)
* win_scheduled_task: add deprecation warning for repetition format * fixed up sanity issues
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
include_tasks: failures.yml
|
||||
|
||||
- name: Test normal scenarios
|
||||
include_tasks: new_tests.yml
|
||||
include_tasks: tests.yml
|
||||
|
||||
- include_tasks: clean.yml
|
||||
|
||||
|
||||
@@ -297,6 +297,7 @@
|
||||
triggers:
|
||||
- type: registration
|
||||
repetition:
|
||||
# TODO: change to dict in 2.12 as a list format is deprecated
|
||||
- interval: PT1M
|
||||
duration: PT5M
|
||||
stop_at_duration_end: yes
|
||||
@@ -313,6 +314,9 @@
|
||||
assert:
|
||||
that:
|
||||
- create_trigger_repetition_check is changed
|
||||
- create_trigger_repetition_check.deprecations|count == 1
|
||||
- create_trigger_repetition_check.deprecations[0].version == "2.12"
|
||||
- create_trigger_repetition_check.deprecations[0].msg == "repetition is a list, should be defined as a dict"
|
||||
- create_trigger_repetition_result_check.task_exists == True
|
||||
- create_trigger_repetition_result_check.triggers|count == 1
|
||||
- create_trigger_repetition_result_check.triggers[0].type == "TASK_TRIGGER_MONTHLYDOW"
|
||||
@@ -334,7 +338,7 @@
|
||||
triggers:
|
||||
- type: registration
|
||||
repetition:
|
||||
- interval: PT1M
|
||||
interval: PT1M
|
||||
duration: PT5M
|
||||
stop_at_duration_end: yes
|
||||
register: create_trigger_repetition
|
||||
@@ -368,7 +372,7 @@
|
||||
triggers:
|
||||
- type: registration
|
||||
repetition:
|
||||
- interval: PT1M
|
||||
interval: PT1M
|
||||
duration: PT5M
|
||||
stop_at_duration_end: yes
|
||||
register: create_trigger_repetition_again
|
||||
@@ -387,7 +391,7 @@
|
||||
triggers:
|
||||
- type: registration
|
||||
repetition:
|
||||
- interval: PT10M
|
||||
interval: PT10M
|
||||
duration: PT20M
|
||||
stop_at_duration_end: no
|
||||
register: change_trigger_repetition_check
|
||||
@@ -422,7 +426,7 @@
|
||||
triggers:
|
||||
- type: registration
|
||||
repetition:
|
||||
- interval: PT10M
|
||||
interval: PT10M
|
||||
duration: PT20M
|
||||
stop_at_duration_end: no
|
||||
register: change_trigger_repetition
|
||||
@@ -456,7 +460,7 @@
|
||||
triggers:
|
||||
- type: registration
|
||||
repetition:
|
||||
- interval: PT10M
|
||||
interval: PT10M
|
||||
duration: PT20M
|
||||
stop_at_duration_end: no
|
||||
register: change_trigger_repetition_again
|
||||
|
||||
@@ -77,6 +77,18 @@
|
||||
- stat_folder_with_task.task_exists is not defined
|
||||
|
||||
# task stat tests
|
||||
- name: get stat of missing task with invalid folder
|
||||
win_scheduled_task_stat:
|
||||
path: fake path
|
||||
name: fake task
|
||||
register: stat_task_missing_folder
|
||||
|
||||
- name: assert get stat of missing task with invalid folder
|
||||
assert:
|
||||
that:
|
||||
- stat_task_missing_folder.folder_exists == False
|
||||
- stat_task_missing_folder.task_exists == False
|
||||
|
||||
- name: get stat of missing task
|
||||
win_scheduled_task_stat:
|
||||
path: '{{test_scheduled_task_stat_path}}'
|
||||
|
||||
@@ -83,7 +83,6 @@ lib/ansible/modules/windows/win_rabbitmq_plugin.ps1 PSAvoidUsingCmdletAliases
|
||||
lib/ansible/modules/windows/win_rabbitmq_plugin.ps1 PSAvoidUsingInvokeExpression
|
||||
lib/ansible/modules/windows/win_region.ps1 PSAvoidUsingEmptyCatchBlock
|
||||
lib/ansible/modules/windows/win_route.ps1 PSAvoidUsingCmdletAliases
|
||||
lib/ansible/modules/windows/win_scheduled_task.ps1 PSAvoidUsingCmdletAliases
|
||||
lib/ansible/modules/windows/win_scheduled_task_stat.ps1 PSAvoidUsingCmdletAliases
|
||||
lib/ansible/modules/windows/win_scheduled_task_stat.ps1 PSUseDeclaredVarsMoreThanAssignments
|
||||
lib/ansible/modules/windows/win_security_policy.ps1 PSUseApprovedVerbs
|
||||
|
||||
Reference in New Issue
Block a user