Fix parameters where type is assumed.
A change is coming to Ansible where module params will default to str. Many of our modules were taking advantage of this by not being explicit about the type, so they will break when that change merges. This hopefully catches those cases.
This commit is contained in:
parent
ca9be1d62c
commit
d7568a50e2
7 changed files with 12 additions and 12 deletions
|
@ -53,7 +53,7 @@ EXAMPLES = '''
|
|||
|
||||
def main():
|
||||
module = AnsibleModule(argument_spec=dict(
|
||||
clouds=dict(required=False, default=[]),
|
||||
clouds=dict(required=False, type='list', default=[]),
|
||||
))
|
||||
p = module.params
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ def main():
|
|||
filename = dict(default=None),
|
||||
ramdisk = dict(default=None),
|
||||
kernel = dict(default=None),
|
||||
properties = dict(default={}),
|
||||
properties = dict(type='dict', default={}),
|
||||
state = dict(default='present', choices=['absent', 'present']),
|
||||
)
|
||||
module_kwargs = openstack_module_kwargs()
|
||||
|
|
|
@ -234,7 +234,7 @@ def main():
|
|||
power=dict(required=False, default='present'),
|
||||
deploy=dict(required=False, default=True),
|
||||
wait=dict(type='bool', required=False, default=False),
|
||||
timeout=dict(required=False, default=1800),
|
||||
timeout=dict(required=False, type='int', default=1800),
|
||||
)
|
||||
module_kwargs = openstack_module_kwargs()
|
||||
module = AnsibleModule(argument_spec, **module_kwargs)
|
||||
|
|
|
@ -117,7 +117,7 @@ def main():
|
|||
|
||||
argument_spec = openstack_full_argument_spec(
|
||||
name=dict(required=False, default=None),
|
||||
filters=dict(required=False, default=None)
|
||||
filters=dict(required=False, type='dict', default=None)
|
||||
)
|
||||
module = AnsibleModule(argument_spec)
|
||||
|
||||
|
|
|
@ -305,13 +305,13 @@ def main():
|
|||
argument_spec = openstack_full_argument_spec(
|
||||
network=dict(required=False),
|
||||
name=dict(required=False),
|
||||
fixed_ips=dict(default=None),
|
||||
admin_state_up=dict(default=None),
|
||||
fixed_ips=dict(type='list', default=None),
|
||||
admin_state_up=dict(type='bool', default=None),
|
||||
mac_address=dict(default=None),
|
||||
security_groups=dict(default=None, type='list'),
|
||||
no_security_groups=dict(default=False, type='bool'),
|
||||
allowed_address_pairs=dict(default=None),
|
||||
extra_dhcp_opt=dict(default=None),
|
||||
allowed_address_pairs=dict(type='dict', default=None),
|
||||
extra_dhcp_opt=dict(type='dict', default=None),
|
||||
device_owner=dict(default=None),
|
||||
device_id=dict(default=None),
|
||||
state=dict(default='present', choices=['absent', 'present']),
|
||||
|
|
|
@ -112,7 +112,7 @@ options:
|
|||
default: None
|
||||
floating_ip_pools:
|
||||
description:
|
||||
- list of floating IP pools from which to choose a floating IP
|
||||
- Name of floating IP pool from which to choose a floating IP
|
||||
required: false
|
||||
default: None
|
||||
meta:
|
||||
|
@ -544,11 +544,11 @@ def main():
|
|||
security_groups = dict(default=['default'], type='list'),
|
||||
network = dict(default=None),
|
||||
nics = dict(default=[], type='list'),
|
||||
meta = dict(default=None),
|
||||
meta = dict(default=None, type='raw'),
|
||||
userdata = dict(default=None, aliases=['user_data']),
|
||||
config_drive = dict(default=False, type='bool'),
|
||||
auto_ip = dict(default=True, type='bool', aliases=['auto_floating_ip', 'public_ip']),
|
||||
floating_ips = dict(default=None),
|
||||
floating_ips = dict(default=None, type='list'),
|
||||
floating_ip_pools = dict(default=None),
|
||||
volume_size = dict(default=False, type='int'),
|
||||
boot_from_volume = dict(default=False, type='bool'),
|
||||
|
|
|
@ -130,7 +130,7 @@ def main():
|
|||
|
||||
argument_spec = openstack_full_argument_spec(
|
||||
name=dict(required=False, default=None),
|
||||
filters=dict(required=False, default=None)
|
||||
filters=dict(required=False, type='dict', default=None)
|
||||
)
|
||||
module = AnsibleModule(argument_spec)
|
||||
|
||||
|
|
Loading…
Reference in a new issue