1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Tidy up validate-modules ignores for cloud/centurylink modules (#1771) (#1812)

* fixed validation-modules for plugins/modules/cloud/centurylink/clc_alert_policy.py

* fixed validation-modules for plugins/modules/cloud/centurylink/clc_blueprint_package.py

* fixed validation-modules for plugins/modules/cloud/centurylink/clc_firewall_policy.py

* fixed validation-modules for plugins/modules/cloud/centurylink/clc_loadbalancer.py

* fixed validation-modules for plugins/modules/cloud/centurylink/clc_modify_server.py

* fixed validation-modules for plugins/modules/cloud/centurylink/clc_publicip.py

* fixed validation-modules for plugins/modules/cloud/centurylink/clc_server_snapshot.py

* fixed validation-modules for plugins/modules/cloud/centurylink/clc_server.py

* Tidy up validate-modules ignores for cloud/centurylink modules

* added changelog fragment per PR

(cherry picked from commit 865acdd4cf)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
Felix Fontein 2021-02-13 12:46:52 +01:00 committed by GitHub
parent e1863a2ff5
commit 21204e1d46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 32 additions and 31 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- clc_* modules - elements of list parameters are now validated (https://github.com/ansible-collections/community.general/pull/1771).

View file

@ -32,6 +32,7 @@ options:
- A list of recipient email ids to notify the alert. - A list of recipient email ids to notify the alert.
This is required for state 'present' This is required for state 'present'
type: list type: list
elements: str
metric: metric:
description: description:
- The metric on which to measure the condition that will trigger the alert. - The metric on which to measure the condition that will trigger the alert.
@ -220,7 +221,7 @@ class ClcAlertPolicy:
name=dict(), name=dict(),
id=dict(), id=dict(),
alias=dict(required=True), alias=dict(required=True),
alert_recipients=dict(type='list'), alert_recipients=dict(type='list', elements='str'),
metric=dict( metric=dict(
choices=[ choices=[
'cpu', 'cpu',

View file

@ -18,6 +18,7 @@ options:
- A list of server Ids to deploy the blue print package. - A list of server Ids to deploy the blue print package.
type: list type: list
required: True required: True
elements: str
package_id: package_id:
description: description:
- The package id of the blue print. - The package id of the blue print.
@ -164,7 +165,7 @@ class ClcBlueprintPackage:
:return: the package dictionary object :return: the package dictionary object
""" """
argument_spec = dict( argument_spec = dict(
server_ids=dict(type='list', required=True), server_ids=dict(type='list', elements='str', required=True),
package_id=dict(required=True), package_id=dict(required=True),
package_params=dict(type='dict', default={}), package_params=dict(type='dict', default={}),
wait=dict(default=True), # @FIXME should be bool? wait=dict(default=True), # @FIXME should be bool?

View file

@ -29,17 +29,20 @@ options:
- The list of source addresses for traffic on the originating firewall. - The list of source addresses for traffic on the originating firewall.
This is required when state is 'present' This is required when state is 'present'
type: list type: list
elements: str
destination: destination:
description: description:
- The list of destination addresses for traffic on the terminating firewall. - The list of destination addresses for traffic on the terminating firewall.
This is required when state is 'present' This is required when state is 'present'
type: list type: list
elements: str
ports: ports:
description: description:
- The list of ports associated with the policy. - The list of ports associated with the policy.
TCP and UDP can take in single ports or port ranges. TCP and UDP can take in single ports or port ranges.
- "Example: C(['any', 'icmp', 'TCP/123', 'UDP/123', 'TCP/123-456', 'UDP/123-456'])." - "Example: C(['any', 'icmp', 'TCP/123', 'UDP/123', 'TCP/123-456', 'UDP/123-456'])."
type: list type: list
elements: str
firewall_policy_id: firewall_policy_id:
description: description:
- Id of the firewall policy. This is required to update or delete an existing firewall policy - Id of the firewall policy. This is required to update or delete an existing firewall policy
@ -217,9 +220,9 @@ class ClcFirewallPolicy:
source_account_alias=dict(required=True), source_account_alias=dict(required=True),
destination_account_alias=dict(), destination_account_alias=dict(),
firewall_policy_id=dict(), firewall_policy_id=dict(),
ports=dict(type='list'), ports=dict(type='list', elements='str'),
source=dict(type='list'), source=dict(type='list', elements='str'),
destination=dict(type='list'), destination=dict(type='list', elements='str'),
wait=dict(default=True), # @FIXME type=bool wait=dict(default=True), # @FIXME type=bool
state=dict(default='present', choices=['present', 'absent']), state=dict(default='present', choices=['present', 'absent']),
enabled=dict(default=True, choices=[True, False]) enabled=dict(default=True, choices=[True, False])

View file

@ -53,6 +53,7 @@ options:
- A list of nodes that needs to be added to the load balancer pool - A list of nodes that needs to be added to the load balancer pool
type: list type: list
default: [] default: []
elements: dict
status: status:
description: description:
- The status of the loadbalancer - The status of the loadbalancer
@ -869,7 +870,7 @@ class ClcLoadBalancer:
port=dict(choices=[80, 443]), port=dict(choices=[80, 443]),
method=dict(choices=['leastConnection', 'roundRobin']), method=dict(choices=['leastConnection', 'roundRobin']),
persistence=dict(choices=['standard', 'sticky']), persistence=dict(choices=['standard', 'sticky']),
nodes=dict(type='list', default=[]), nodes=dict(type='list', default=[], elements='dict'),
status=dict(default='enabled', choices=['enabled', 'disabled']), status=dict(default='enabled', choices=['enabled', 'disabled']),
state=dict( state=dict(
default='present', default='present',

View file

@ -18,6 +18,7 @@ options:
- A list of server Ids to modify. - A list of server Ids to modify.
type: list type: list
required: True required: True
elements: str
cpu: cpu:
description: description:
- How many CPUs to update on the server - How many CPUs to update on the server
@ -396,7 +397,7 @@ class ClcModifyServer:
:return: argument spec dictionary :return: argument spec dictionary
""" """
argument_spec = dict( argument_spec = dict(
server_ids=dict(type='list', required=True), server_ids=dict(type='list', required=True, elements='str'),
state=dict(default='present', choices=['present', 'absent']), state=dict(default='present', choices=['present', 'absent']),
cpu=dict(), cpu=dict(),
memory=dict(), memory=dict(),

View file

@ -23,11 +23,13 @@ options:
description: description:
- A list of ports to expose. This is required when state is 'present' - A list of ports to expose. This is required when state is 'present'
type: list type: list
elements: int
server_ids: server_ids:
description: description:
- A list of servers to create public ips on. - A list of servers to create public ips on.
type: list type: list
required: True required: True
elements: str
state: state:
description: description:
- Determine whether to create or delete public IPs. If present module will not create a second public ip if one - Determine whether to create or delete public IPs. If present module will not create a second public ip if one
@ -193,9 +195,9 @@ class ClcPublicIp(object):
:return: argument spec dictionary :return: argument spec dictionary
""" """
argument_spec = dict( argument_spec = dict(
server_ids=dict(type='list', required=True), server_ids=dict(type='list', required=True, elements='str'),
protocol=dict(default='TCP', choices=['TCP', 'UDP', 'ICMP']), protocol=dict(default='TCP', choices=['TCP', 'UDP', 'ICMP']),
ports=dict(type='list'), ports=dict(type='list', elements='int'),
wait=dict(type='bool', default=True), wait=dict(type='bool', default=True),
state=dict(default='present', choices=['present', 'absent']), state=dict(default='present', choices=['present', 'absent']),
) )

View file

@ -17,6 +17,7 @@ options:
description: description:
- The list of additional disks for the server - The list of additional disks for the server
type: list type: list
elements: dict
default: [] default: []
add_public_ip: add_public_ip:
description: description:
@ -66,6 +67,7 @@ options:
- The list of custom fields to set on the server. - The list of custom fields to set on the server.
type: list type: list
default: [] default: []
elements: dict
description: description:
description: description:
- The description to set for the server. - The description to set for the server.
@ -111,6 +113,7 @@ options:
description: description:
- The list of blue print packages to run on the server after its created. - The list of blue print packages to run on the server after its created.
type: list type: list
elements: dict
default: [] default: []
password: password:
description: description:
@ -130,6 +133,7 @@ options:
description: description:
- A list of ports to allow on the firewall to the servers public ip, if add_public_ip is set to True. - A list of ports to allow on the firewall to the servers public ip, if add_public_ip is set to True.
type: list type: list
elements: dict
default: [] default: []
secondary_dns: secondary_dns:
description: description:
@ -141,6 +145,7 @@ options:
A list of server Ids to insure are started, stopped, or absent. A list of server Ids to insure are started, stopped, or absent.
type: list type: list
default: [] default: []
elements: str
source_server_password: source_server_password:
description: description:
- The password for the source server if a clone is specified. - The password for the source server if a clone is specified.
@ -575,8 +580,8 @@ class ClcServer:
type=dict(default='standard', choices=['standard', 'hyperscale', 'bareMetal']), type=dict(default='standard', choices=['standard', 'hyperscale', 'bareMetal']),
primary_dns=dict(default=None), primary_dns=dict(default=None),
secondary_dns=dict(default=None), secondary_dns=dict(default=None),
additional_disks=dict(type='list', default=[]), additional_disks=dict(type='list', default=[], elements='dict'),
custom_fields=dict(type='list', default=[]), custom_fields=dict(type='list', default=[], elements='dict'),
ttl=dict(default=None), ttl=dict(default=None),
managed_os=dict(type='bool', default=False), managed_os=dict(type='bool', default=False),
description=dict(default=None), description=dict(default=None),
@ -586,7 +591,7 @@ class ClcServer:
anti_affinity_policy_name=dict(default=None), anti_affinity_policy_name=dict(default=None),
alert_policy_id=dict(default=None), alert_policy_id=dict(default=None),
alert_policy_name=dict(default=None), alert_policy_name=dict(default=None),
packages=dict(type='list', default=[]), packages=dict(type='list', default=[], elements='dict'),
state=dict( state=dict(
default='present', default='present',
choices=[ choices=[
@ -597,7 +602,7 @@ class ClcServer:
count=dict(type='int', default=1), count=dict(type='int', default=1),
exact_count=dict(type='int', default=None), exact_count=dict(type='int', default=None),
count_group=dict(), count_group=dict(),
server_ids=dict(type='list', default=[]), server_ids=dict(type='list', default=[], elements='str'),
add_public_ip=dict(type='bool', default=False), add_public_ip=dict(type='bool', default=False),
public_ip_protocol=dict( public_ip_protocol=dict(
default='TCP', default='TCP',
@ -605,7 +610,7 @@ class ClcServer:
'TCP', 'TCP',
'UDP', 'UDP',
'ICMP']), 'ICMP']),
public_ip_ports=dict(type='list', default=[]), public_ip_ports=dict(type='list', default=[], elements='dict'),
configuration_id=dict(default=None), configuration_id=dict(default=None),
os_type=dict(default=None, os_type=dict(default=None,
choices=[ choices=[

View file

@ -18,6 +18,7 @@ options:
- The list of CLC server Ids. - The list of CLC server Ids.
type: list type: list
required: True required: True
elements: str
expiration_days: expiration_days:
description: description:
- The number of days to keep the server snapshot before it expires. - The number of days to keep the server snapshot before it expires.
@ -330,7 +331,7 @@ class ClcSnapshot:
:return: the package dictionary object :return: the package dictionary object
""" """
argument_spec = dict( argument_spec = dict(
server_ids=dict(type='list', required=True), server_ids=dict(type='list', required=True, elements='str'),
expiration_days=dict(default=7, type='int'), expiration_days=dict(default=7, type='int'),
wait=dict(default=True), wait=dict(default=True),
state=dict( state=dict(

View file

@ -5,14 +5,6 @@ plugins/module_utils/compat/ipaddress.py no-assert
plugins/module_utils/compat/ipaddress.py no-unicode-literals plugins/module_utils/compat/ipaddress.py no-unicode-literals
plugins/module_utils/_mount.py future-import-boilerplate plugins/module_utils/_mount.py future-import-boilerplate
plugins/module_utils/_mount.py metaclass-boilerplate plugins/module_utils/_mount.py metaclass-boilerplate
plugins/modules/cloud/centurylink/clc_alert_policy.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/centurylink/clc_blueprint_package.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/centurylink/clc_firewall_policy.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/centurylink/clc_loadbalancer.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/centurylink/clc_modify_server.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/centurylink/clc_publicip.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/centurylink/clc_server.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/centurylink/clc_server_snapshot.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/docker/docker_container.py use-argspec-type-path # uses colon-separated paths, can't use type=path plugins/modules/cloud/docker/docker_container.py use-argspec-type-path # uses colon-separated paths, can't use type=path
plugins/modules/cloud/google/gcdns_record.py validate-modules:parameter-list-no-elements plugins/modules/cloud/google/gcdns_record.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/google/gce.py pylint:blacklisted-name plugins/modules/cloud/google/gce.py pylint:blacklisted-name

View file

@ -4,14 +4,6 @@ plugins/module_utils/compat/ipaddress.py no-assert
plugins/module_utils/compat/ipaddress.py no-unicode-literals plugins/module_utils/compat/ipaddress.py no-unicode-literals
plugins/module_utils/_mount.py future-import-boilerplate plugins/module_utils/_mount.py future-import-boilerplate
plugins/module_utils/_mount.py metaclass-boilerplate plugins/module_utils/_mount.py metaclass-boilerplate
plugins/modules/cloud/centurylink/clc_alert_policy.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/centurylink/clc_blueprint_package.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/centurylink/clc_firewall_policy.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/centurylink/clc_loadbalancer.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/centurylink/clc_modify_server.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/centurylink/clc_publicip.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/centurylink/clc_server.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/centurylink/clc_server_snapshot.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/docker/docker_container.py use-argspec-type-path # uses colon-separated paths, can't use type=path plugins/modules/cloud/docker/docker_container.py use-argspec-type-path # uses colon-separated paths, can't use type=path
plugins/modules/cloud/google/gcdns_record.py validate-modules:parameter-list-no-elements plugins/modules/cloud/google/gcdns_record.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/google/gce.py validate-modules:parameter-list-no-elements plugins/modules/cloud/google/gce.py validate-modules:parameter-list-no-elements