From f8859af3774627ca304239da47725406e0e326e2 Mon Sep 17 00:00:00 2001 From: Alexei Znamensky <103110+russoz@users.noreply.github.com> Date: Sun, 14 Mar 2021 22:53:49 +1300 Subject: [PATCH] Tidy up sanity checks ignore lines modules (batch 8) (#2006) * fixed validation-modules for plugins/modules/cloud/smartos/smartos_image_info.py * fixed validation-modules for plugins/modules/cloud/rackspace/rax_scaling_group.py * fixed validation-modules for plugins/modules/cloud/rackspace/rax_cdb_user.py * fixed validation-modules for plugins/modules/cloud/rackspace/rax.py * Tidy up sanity checks ignore lines modules (batch 8) * added changelog fragment * rolled back removal of parameter from rax.py --- changelogs/fragments/2006-valmod-batch8.yml | 4 ++++ plugins/modules/cloud/rackspace/rax.py | 6 ++++-- plugins/modules/cloud/rackspace/rax_cdb_user.py | 3 ++- plugins/modules/cloud/rackspace/rax_scaling_group.py | 6 ++++-- plugins/modules/cloud/smartos/smartos_image_info.py | 1 + tests/sanity/ignore-2.10.txt | 6 +----- tests/sanity/ignore-2.11.txt | 6 +----- tests/sanity/ignore-2.9.txt | 3 +-- 8 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 changelogs/fragments/2006-valmod-batch8.yml diff --git a/changelogs/fragments/2006-valmod-batch8.yml b/changelogs/fragments/2006-valmod-batch8.yml new file mode 100644 index 0000000000..30be5e16b2 --- /dev/null +++ b/changelogs/fragments/2006-valmod-batch8.yml @@ -0,0 +1,4 @@ +minor_changes: + - rax - elements of list parameters are now validated (https://github.com/ansible-collections/community.general/pull/2006). + - rax_cdb_user - elements of list parameters are now validated (https://github.com/ansible-collections/community.general/pull/2006). + - rax_scaling_group - elements of list parameters are now validated (https://github.com/ansible-collections/community.general/pull/2006). diff --git a/plugins/modules/cloud/rackspace/rax.py b/plugins/modules/cloud/rackspace/rax.py index 9f7df5c45b..d2d9119b02 100644 --- a/plugins/modules/cloud/rackspace/rax.py +++ b/plugins/modules/cloud/rackspace/rax.py @@ -110,6 +110,7 @@ options: with this image instance_ids: type: list + elements: str description: - list of instance ids, currently only used when state='absent' to remove instances @@ -129,6 +130,7 @@ options: - Name to give the instance networks: type: list + elements: str description: - The network to attach to the instances. If specified, you must include ALL networks including the public and private interfaces. Can be C(id) @@ -810,11 +812,11 @@ def main(): flavor=dict(), group=dict(), image=dict(), - instance_ids=dict(type='list'), + instance_ids=dict(type='list', elements='str'), key_name=dict(aliases=['keypair']), meta=dict(type='dict', default={}), name=dict(), - networks=dict(type='list', default=['public', 'private']), + networks=dict(type='list', elements='str', default=['public', 'private']), service=dict(), state=dict(default='present', choices=['present', 'absent']), user_data=dict(no_log=True), diff --git a/plugins/modules/cloud/rackspace/rax_cdb_user.py b/plugins/modules/cloud/rackspace/rax_cdb_user.py index 34be49d862..2034170f42 100644 --- a/plugins/modules/cloud/rackspace/rax_cdb_user.py +++ b/plugins/modules/cloud/rackspace/rax_cdb_user.py @@ -30,6 +30,7 @@ options: required: yes databases: type: list + elements: str description: - Name of the databases that the user can access default: [] @@ -189,7 +190,7 @@ def main(): cdb_id=dict(type='str', required=True), db_username=dict(type='str', required=True), db_password=dict(type='str', required=True, no_log=True), - databases=dict(type='list', default=[]), + databases=dict(type='list', elements='str', default=[]), host=dict(type='str', default='%'), state=dict(default='present', choices=['present', 'absent']) ) diff --git a/plugins/modules/cloud/rackspace/rax_scaling_group.py b/plugins/modules/cloud/rackspace/rax_scaling_group.py index 7b2b6ace79..2f8fa0a2cc 100644 --- a/plugins/modules/cloud/rackspace/rax_scaling_group.py +++ b/plugins/modules/cloud/rackspace/rax_scaling_group.py @@ -53,6 +53,7 @@ options: - key pair to use on the instance loadbalancers: type: list + elements: dict description: - List of load balancer C(id) and C(port) hashes max_entities: @@ -78,6 +79,7 @@ options: required: true networks: type: list + elements: str description: - The network to attach to the instances. If specified, you must include ALL networks including the public and private interfaces. Can be C(id) @@ -376,12 +378,12 @@ def main(): flavor=dict(required=True), image=dict(required=True), key_name=dict(), - loadbalancers=dict(type='list'), + loadbalancers=dict(type='list', elements='dict'), meta=dict(type='dict', default={}), min_entities=dict(type='int', required=True), max_entities=dict(type='int', required=True), name=dict(required=True), - networks=dict(type='list', default=['public', 'private']), + networks=dict(type='list', elements='str', default=['public', 'private']), server_name=dict(required=True), state=dict(default='present', choices=['present', 'absent']), user_data=dict(no_log=True), diff --git a/plugins/modules/cloud/smartos/smartos_image_info.py b/plugins/modules/cloud/smartos/smartos_image_info.py index 17761af8a5..473d345ad8 100644 --- a/plugins/modules/cloud/smartos/smartos_image_info.py +++ b/plugins/modules/cloud/smartos/smartos_image_info.py @@ -24,6 +24,7 @@ options: manifest and 'published_date', 'published', 'source', 'clones', and 'size'. More information can be found at U(https://smartos.org/man/1m/imgadm) under 'imgadm list'. + type: str ''' EXAMPLES = ''' diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index 6cc090eefd..bb78528220 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -65,14 +65,11 @@ plugins/modules/cloud/ovirt/ovirt_vmpool_facts.py validate-modules:doc-missing-t plugins/modules/cloud/ovirt/ovirt_vmpool_facts.py validate-modules:parameter-list-no-elements plugins/modules/cloud/rackspace/rax.py use-argspec-type-path # fix needed plugins/modules/cloud/rackspace/rax.py validate-modules:doc-missing-type -plugins/modules/cloud/rackspace/rax.py validate-modules:parameter-list-no-elements plugins/modules/cloud/rackspace/rax.py validate-modules:undocumented-parameter -plugins/modules/cloud/rackspace/rax_cdb_user.py validate-modules:parameter-list-no-elements 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 -plugins/modules/cloud/rackspace/rax_scaling_group.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_image_facts.py validate-modules:return-syntax-error plugins/modules/cloud/scaleway/scaleway_image_info.py validate-modules:return-syntax-error plugins/modules/cloud/scaleway/scaleway_ip_facts.py validate-modules:return-syntax-error @@ -87,7 +84,6 @@ plugins/modules/cloud/scaleway/scaleway_snapshot_facts.py validate-modules:retur plugins/modules/cloud/scaleway/scaleway_snapshot_info.py validate-modules:return-syntax-error plugins/modules/cloud/scaleway/scaleway_volume_facts.py validate-modules:return-syntax-error plugins/modules/cloud/scaleway/scaleway_volume_info.py validate-modules:return-syntax-error -plugins/modules/cloud/smartos/smartos_image_info.py validate-modules:doc-missing-type plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc plugins/modules/cloud/smartos/vmadm.py validate-modules:undocumented-parameter plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-list-no-elements diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index b718639b77..c30978e247 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -64,14 +64,11 @@ plugins/modules/cloud/ovirt/ovirt_vmpool_facts.py validate-modules:doc-missing-t plugins/modules/cloud/ovirt/ovirt_vmpool_facts.py validate-modules:parameter-list-no-elements plugins/modules/cloud/rackspace/rax.py use-argspec-type-path # fix needed plugins/modules/cloud/rackspace/rax.py validate-modules:doc-missing-type -plugins/modules/cloud/rackspace/rax.py validate-modules:parameter-list-no-elements plugins/modules/cloud/rackspace/rax.py validate-modules:undocumented-parameter -plugins/modules/cloud/rackspace/rax_cdb_user.py validate-modules:parameter-list-no-elements 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 -plugins/modules/cloud/rackspace/rax_scaling_group.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_image_facts.py validate-modules:return-syntax-error plugins/modules/cloud/scaleway/scaleway_image_info.py validate-modules:return-syntax-error plugins/modules/cloud/scaleway/scaleway_ip_facts.py validate-modules:return-syntax-error @@ -86,7 +83,6 @@ plugins/modules/cloud/scaleway/scaleway_snapshot_facts.py validate-modules:retur plugins/modules/cloud/scaleway/scaleway_snapshot_info.py validate-modules:return-syntax-error plugins/modules/cloud/scaleway/scaleway_volume_facts.py validate-modules:return-syntax-error plugins/modules/cloud/scaleway/scaleway_volume_info.py validate-modules:return-syntax-error -plugins/modules/cloud/smartos/smartos_image_info.py validate-modules:doc-missing-type plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc plugins/modules/cloud/smartos/vmadm.py validate-modules:undocumented-parameter plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-list-no-elements diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index 06e83d3535..0782b31593 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -97,7 +97,7 @@ plugins/modules/cloud/rackspace/rax.py use-argspec-type-path plugins/modules/cloud/rackspace/rax.py validate-modules:doc-missing-type plugins/modules/cloud/rackspace/rax.py validate-modules:undocumented-parameter plugins/modules/cloud/rackspace/rax_files_objects.py use-argspec-type-path -plugins/modules/cloud/rackspace/rax_scaling_group.py use-argspec-type-path +plugins/modules/cloud/rackspace/rax_scaling_group.py use-argspec-type-path # fix needed, expanduser() applied to dict values plugins/modules/cloud/scaleway/scaleway_image_facts.py validate-modules:deprecation-mismatch plugins/modules/cloud/scaleway/scaleway_image_facts.py validate-modules:invalid-documentation plugins/modules/cloud/scaleway/scaleway_image_facts.py validate-modules:return-syntax-error @@ -126,7 +126,6 @@ plugins/modules/cloud/scaleway/scaleway_volume_facts.py validate-modules:depreca plugins/modules/cloud/scaleway/scaleway_volume_facts.py validate-modules:invalid-documentation plugins/modules/cloud/scaleway/scaleway_volume_facts.py validate-modules:return-syntax-error plugins/modules/cloud/scaleway/scaleway_volume_info.py validate-modules:return-syntax-error -plugins/modules/cloud/smartos/smartos_image_info.py validate-modules:doc-missing-type plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc plugins/modules/cloud/smartos/vmadm.py validate-modules:undocumented-parameter plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc