From bea397b4582e54dc705e7439b7c47734e3faca23 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Thu, 11 Apr 2019 01:49:00 +0530 Subject: [PATCH] Add type int for various argument params (#55026) Specify type as int for various arguments where default value is int. Fixes: #55005 Signed-off-by: Abhijeet Kasurde --- lib/ansible/modules/cloud/amazon/ec2_eip.py | 2 +- lib/ansible/modules/cloud/amazon/ec2_key.py | 2 +- lib/ansible/modules/cloud/amazon/lightsail.py | 2 +- lib/ansible/modules/cloud/centurylink/clc_server.py | 4 ++-- .../modules/cloud/centurylink/clc_server_snapshot.py | 2 +- lib/ansible/modules/cloud/google/gce_lb.py | 10 +++++----- lib/ansible/modules/cloud/linode/linode.py | 2 +- .../cloud/profitbricks/profitbricks_datacenter.py | 2 +- lib/ansible/modules/cloud/rackspace/rax.py | 2 +- lib/ansible/modules/cloud/rackspace/rax_clb.py | 2 +- .../modules/cloud/rackspace/rax_scaling_group.py | 2 +- lib/ansible/modules/monitoring/logicmonitor.py | 2 +- lib/ansible/modules/monitoring/nagios.py | 2 +- lib/ansible/modules/network/illumos/ipadm_addr.py | 2 +- lib/ansible/modules/network/nxos/nxos_ping.py | 2 +- lib/ansible/modules/notification/jabber.py | 2 +- 16 files changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_eip.py b/lib/ansible/modules/cloud/amazon/ec2_eip.py index 1811978cdbb..f8474d483cc 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_eip.py +++ b/lib/ansible/modules/cloud/amazon/ec2_eip.py @@ -381,7 +381,7 @@ def main(): default=False), release_on_disassociation=dict(required=False, type='bool', default=False), allow_reassociation=dict(type='bool', default=False), - wait_timeout=dict(default=300), + wait_timeout=dict(default=300, type='int'), private_ip_address=dict(required=False, default=None, type='str') )) diff --git a/lib/ansible/modules/cloud/amazon/ec2_key.py b/lib/ansible/modules/cloud/amazon/ec2_key.py index 3969035427f..e3c9b14fda3 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_key.py +++ b/lib/ansible/modules/cloud/amazon/ec2_key.py @@ -249,7 +249,7 @@ def main(): force=dict(type='bool', default=True), state=dict(default='present', choices=['present', 'absent']), wait=dict(type='bool', default=False), - wait_timeout=dict(default=300) + wait_timeout=dict(default=300, type='int') ) ) diff --git a/lib/ansible/modules/cloud/amazon/lightsail.py b/lib/ansible/modules/cloud/amazon/lightsail.py index dfe6443fbe2..202d62458e7 100644 --- a/lib/ansible/modules/cloud/amazon/lightsail.py +++ b/lib/ansible/modules/cloud/amazon/lightsail.py @@ -443,7 +443,7 @@ def main(): key_pair_name=dict(type='str'), user_data=dict(type='str'), wait=dict(type='bool', default=True), - wait_timeout=dict(default=300), + wait_timeout=dict(default=300, type='int'), )) module = AnsibleModule(argument_spec=argument_spec) diff --git a/lib/ansible/modules/cloud/centurylink/clc_server.py b/lib/ansible/modules/cloud/centurylink/clc_server.py index 4d75d204aac..4a307d7ec6e 100644 --- a/lib/ansible/modules/cloud/centurylink/clc_server.py +++ b/lib/ansible/modules/cloud/centurylink/clc_server.py @@ -534,8 +534,8 @@ class ClcServer: group=dict(default='Default Group'), network_id=dict(), location=dict(default=None), - cpu=dict(default=1), - memory=dict(default=1), + cpu=dict(default=1, type='int'), + memory=dict(default=1, type='int'), alias=dict(default=None), password=dict(default=None, no_log=True), ip_address=dict(default=None), diff --git a/lib/ansible/modules/cloud/centurylink/clc_server_snapshot.py b/lib/ansible/modules/cloud/centurylink/clc_server_snapshot.py index 80353219fb5..48ee4b9b43e 100644 --- a/lib/ansible/modules/cloud/centurylink/clc_server_snapshot.py +++ b/lib/ansible/modules/cloud/centurylink/clc_server_snapshot.py @@ -334,7 +334,7 @@ class ClcSnapshot: """ argument_spec = dict( server_ids=dict(type='list', required=True), - expiration_days=dict(default=7), + expiration_days=dict(default=7, type='int'), wait=dict(default=True), state=dict( default='present', diff --git a/lib/ansible/modules/cloud/google/gce_lb.py b/lib/ansible/modules/cloud/google/gce_lb.py index 4256e554fcc..1bfa0c58bfe 100644 --- a/lib/ansible/modules/cloud/google/gce_lb.py +++ b/lib/ansible/modules/cloud/google/gce_lb.py @@ -140,12 +140,12 @@ def main(): module = AnsibleModule( argument_spec=dict( httphealthcheck_name=dict(), - httphealthcheck_port=dict(default=80), + httphealthcheck_port=dict(default=80, type='int'), httphealthcheck_path=dict(default='/'), - httphealthcheck_interval=dict(default=5), - httphealthcheck_timeout=dict(default=5), - httphealthcheck_unhealthy_count=dict(default=2), - httphealthcheck_healthy_count=dict(default=2), + httphealthcheck_interval=dict(default=5, type='int'), + httphealthcheck_timeout=dict(default=5, type='int'), + httphealthcheck_unhealthy_count=dict(default=2, type='int'), + httphealthcheck_healthy_count=dict(default=2, type='int'), httphealthcheck_host=dict(), name=dict(), protocol=dict(default='tcp'), diff --git a/lib/ansible/modules/cloud/linode/linode.py b/lib/ansible/modules/cloud/linode/linode.py index d13c7a435af..3f298c9a442 100644 --- a/lib/ansible/modules/cloud/linode/linode.py +++ b/lib/ansible/modules/cloud/linode/linode.py @@ -605,7 +605,7 @@ def main(): ssh_pub_key=dict(type='str'), swap=dict(type='int', default=512), wait=dict(type='bool', default=True), - wait_timeout=dict(default=300), + wait_timeout=dict(type='int', default=300), watchdog=dict(type='bool', default=True), ), ) diff --git a/lib/ansible/modules/cloud/profitbricks/profitbricks_datacenter.py b/lib/ansible/modules/cloud/profitbricks/profitbricks_datacenter.py index 1705501b9bf..c28a0c9afd3 100644 --- a/lib/ansible/modules/cloud/profitbricks/profitbricks_datacenter.py +++ b/lib/ansible/modules/cloud/profitbricks/profitbricks_datacenter.py @@ -210,7 +210,7 @@ def main(): subscription_user=dict(), subscription_password=dict(no_log=True), wait=dict(type='bool', default=True), - wait_timeout=dict(default=600), + wait_timeout=dict(default=600, type='int'), state=dict(default='present'), ) ) diff --git a/lib/ansible/modules/cloud/rackspace/rax.py b/lib/ansible/modules/cloud/rackspace/rax.py index c27a10ab8c8..d69e722b74e 100644 --- a/lib/ansible/modules/cloud/rackspace/rax.py +++ b/lib/ansible/modules/cloud/rackspace/rax.py @@ -820,7 +820,7 @@ def main(): state=dict(default='present', choices=['present', 'absent']), user_data=dict(no_log=True), wait=dict(default=False, type='bool'), - wait_timeout=dict(default=300), + wait_timeout=dict(default=300, type='int'), ) ) diff --git a/lib/ansible/modules/cloud/rackspace/rax_clb.py b/lib/ansible/modules/cloud/rackspace/rax_clb.py index 022050a87a8..9f70ee97b7a 100644 --- a/lib/ansible/modules/cloud/rackspace/rax_clb.py +++ b/lib/ansible/modules/cloud/rackspace/rax_clb.py @@ -272,7 +272,7 @@ def main(): type=dict(choices=['PUBLIC', 'SERVICENET'], default='PUBLIC'), vip_id=dict(), wait=dict(type='bool'), - wait_timeout=dict(default=300), + wait_timeout=dict(type='int', default=300), ) ) diff --git a/lib/ansible/modules/cloud/rackspace/rax_scaling_group.py b/lib/ansible/modules/cloud/rackspace/rax_scaling_group.py index cb12841bb45..29c4972ab9a 100644 --- a/lib/ansible/modules/cloud/rackspace/rax_scaling_group.py +++ b/lib/ansible/modules/cloud/rackspace/rax_scaling_group.py @@ -376,7 +376,7 @@ def main(): state=dict(default='present', choices=['present', 'absent']), user_data=dict(no_log=True), wait=dict(default=False, type='bool'), - wait_timeout=dict(default=300), + wait_timeout=dict(default=300, type='int'), ) ) diff --git a/lib/ansible/modules/monitoring/logicmonitor.py b/lib/ansible/modules/monitoring/logicmonitor.py index 7d48292e850..570777f4351 100644 --- a/lib/ansible/modules/monitoring/logicmonitor.py +++ b/lib/ansible/modules/monitoring/logicmonitor.py @@ -2121,7 +2121,7 @@ def main(): description=dict(required=False, default=""), fullpath=dict(required=False, default=None), starttime=dict(required=False, default=None), - duration=dict(required=False, default=30), + duration=dict(required=False, default=30, type='int'), properties=dict(required=False, default={}, type="dict"), groups=dict(required=False, default=[], type="list"), alertenable=dict(required=False, default="true", type="bool") diff --git a/lib/ansible/modules/monitoring/nagios.py b/lib/ansible/modules/monitoring/nagios.py index 892fbc322cf..0bffdca9e70 100644 --- a/lib/ansible/modules/monitoring/nagios.py +++ b/lib/ansible/modules/monitoring/nagios.py @@ -260,7 +260,7 @@ def main(): comment=dict(default='Scheduling downtime'), host=dict(required=False, default=None), servicegroup=dict(required=False, default=None), - minutes=dict(default=30), + minutes=dict(default=30, type='int'), cmdfile=dict(default=which_cmdfile()), services=dict(default=None, aliases=['service']), command=dict(required=False, default=None), diff --git a/lib/ansible/modules/network/illumos/ipadm_addr.py b/lib/ansible/modules/network/illumos/ipadm_addr.py index 12f5337eee9..5fd8450d908 100644 --- a/lib/ansible/modules/network/illumos/ipadm_addr.py +++ b/lib/ansible/modules/network/illumos/ipadm_addr.py @@ -268,7 +268,7 @@ def main(): temporary=dict(default=False, type='bool'), state=dict( default='present', choices=['absent', 'present', 'up', 'down', 'enabled', 'disabled', 'refreshed']), - wait=dict(default=60), + wait=dict(default=60, type='int'), ), mutually_exclusive=[ ('address', 'wait'), diff --git a/lib/ansible/modules/network/nxos/nxos_ping.py b/lib/ansible/modules/network/nxos/nxos_ping.py index 2fdabbe6c4b..d2340e6a5f6 100644 --- a/lib/ansible/modules/network/nxos/nxos_ping.py +++ b/lib/ansible/modules/network/nxos/nxos_ping.py @@ -178,7 +178,7 @@ def get_ping_results(command, module): def main(): argument_spec = dict( dest=dict(required=True), - count=dict(required=False, default=5), + count=dict(required=False, default=5, type='int'), vrf=dict(required=False), source=dict(required=False), state=dict(required=False, choices=['present', 'absent'], default='present'), diff --git a/lib/ansible/modules/notification/jabber.py b/lib/ansible/modules/notification/jabber.py index 1007cab198c..dc5bf0d0d67 100644 --- a/lib/ansible/modules/notification/jabber.py +++ b/lib/ansible/modules/notification/jabber.py @@ -103,7 +103,7 @@ def main(): to=dict(required=True), msg=dict(required=True), host=dict(required=False), - port=dict(required=False, default=5222), + port=dict(required=False, default=5222, type='int'), encoding=dict(required=False), ), supports_check_mode=True