From 8c9add3d158bc79966446492bc61e61ef6723593 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 14:17:06 +0200 Subject: [PATCH] rax_mon_notification_plan - fixed validation check (#2955) (#2977) * fixed validation-modules for plugins/modules/cloud/rackspace/rax_mon_notification_plan.py * fixed sanity check * added changelog fragment (cherry picked from commit 0e90ff48b5e0d3c3b51542fc843d3d873d04a2d5) Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --- ..._notification_plan-added-elements-to-list-params.yaml | 2 ++ .../modules/cloud/rackspace/rax_mon_notification_plan.py | 9 ++++++--- tests/sanity/ignore-2.10.txt | 1 - tests/sanity/ignore-2.11.txt | 1 - tests/sanity/ignore-2.12.txt | 1 - 5 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 changelogs/fragments/2955-rax_mon_notification_plan-added-elements-to-list-params.yaml diff --git a/changelogs/fragments/2955-rax_mon_notification_plan-added-elements-to-list-params.yaml b/changelogs/fragments/2955-rax_mon_notification_plan-added-elements-to-list-params.yaml new file mode 100644 index 0000000000..9ff6f01f7d --- /dev/null +++ b/changelogs/fragments/2955-rax_mon_notification_plan-added-elements-to-list-params.yaml @@ -0,0 +1,2 @@ +minor_changes: + - rax_mon_notification_plan - fixed validation checks by specifying type ``str`` as the ``elements`` of parameters ``ok_state``, ``warning_state`` and ``critical_state`` (https://github.com/ansible-collections/community.general/pull/2955). diff --git a/plugins/modules/cloud/rackspace/rax_mon_notification_plan.py b/plugins/modules/cloud/rackspace/rax_mon_notification_plan.py index a4b8920dc7..d5294cd509 100644 --- a/plugins/modules/cloud/rackspace/rax_mon_notification_plan.py +++ b/plugins/modules/cloud/rackspace/rax_mon_notification_plan.py @@ -32,16 +32,19 @@ options: required: true critical_state: type: list + elements: str description: - Notification list to use when the alarm state is CRITICAL. Must be an array of valid rax_mon_notification ids. warning_state: type: list + elements: str description: - Notification list to use when the alarm state is WARNING. Must be an array of valid rax_mon_notification ids. ok_state: type: list + elements: str description: - Notification list to use when the alarm state is OK. Must be an array of valid rax_mon_notification ids. @@ -150,9 +153,9 @@ def main(): dict( state=dict(default='present', choices=['present', 'absent']), label=dict(required=True), - critical_state=dict(type='list'), - warning_state=dict(type='list'), - ok_state=dict(type='list') + critical_state=dict(type='list', elements='str'), + warning_state=dict(type='list', elements='str'), + ok_state=dict(type='list', elements='str'), ) ) diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index 12f7d72faf..69067b4195 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -7,7 +7,6 @@ plugins/modules/cloud/misc/rhevm.py validate-modules:parameter-state-invalid-cho plugins/modules/cloud/rackspace/rax.py use-argspec-type-path # fix needed plugins/modules/cloud/rackspace/rax_files.py validate-modules:parameter-state-invalid-choice plugins/modules/cloud/rackspace/rax_files_objects.py use-argspec-type-path -plugins/modules/cloud/rackspace/rax_mon_notification_plan.py validate-modules:parameter-list-no-elements plugins/modules/cloud/rackspace/rax_scaling_group.py use-argspec-type-path # fix needed, expanduser() applied to dict values plugins/modules/cloud/scaleway/scaleway_organization_info.py validate-modules:return-syntax-error plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index 892142030a..bed154dc96 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -6,7 +6,6 @@ plugins/modules/cloud/misc/rhevm.py validate-modules:parameter-state-invalid-cho plugins/modules/cloud/rackspace/rax.py use-argspec-type-path # fix needed plugins/modules/cloud/rackspace/rax_files.py validate-modules:parameter-state-invalid-choice plugins/modules/cloud/rackspace/rax_files_objects.py use-argspec-type-path -plugins/modules/cloud/rackspace/rax_mon_notification_plan.py validate-modules:parameter-list-no-elements plugins/modules/cloud/rackspace/rax_scaling_group.py use-argspec-type-path # fix needed, expanduser() applied to dict values plugins/modules/cloud/scaleway/scaleway_organization_info.py validate-modules:return-syntax-error plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index cb90eed905..598a89e627 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -6,7 +6,6 @@ plugins/modules/cloud/misc/rhevm.py validate-modules:parameter-state-invalid-cho plugins/modules/cloud/rackspace/rax.py use-argspec-type-path # fix needed plugins/modules/cloud/rackspace/rax_files.py validate-modules:parameter-state-invalid-choice plugins/modules/cloud/rackspace/rax_files_objects.py use-argspec-type-path -plugins/modules/cloud/rackspace/rax_mon_notification_plan.py validate-modules:parameter-list-no-elements plugins/modules/cloud/rackspace/rax_scaling_group.py use-argspec-type-path # fix needed, expanduser() applied to dict values plugins/modules/cloud/scaleway/scaleway_organization_info.py validate-modules:return-syntax-error plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc