Skip to content

Commit

Permalink
Removed 'default=None' in a batch of modules 2 (#4567)
Browse files Browse the repository at this point in the history
* removed default=None

* added changelog fragment

(cherry picked from commit 3b103f9)
  • Loading branch information
russoz authored and patchback[bot] committed Apr 24, 2022
1 parent 69e5a0d commit 580fafb
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 36 deletions.
13 changes: 13 additions & 0 deletions changelogs/fragments/4567-remove-default-none-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
minor_changes:
- atomic_container - minor refactoring (https://github.com/ansible-collections/community.general/pull/4567).
- proxmox - minor refactoring (https://github.com/ansible-collections/community.general/pull/4567).
- packet_device - minor refactoring (https://github.com/ansible-collections/community.general/pull/4567).
- packet_sshkey - minor refactoring (https://github.com/ansible-collections/community.general/pull/4567).
- packet_volume - minor refactoring (https://github.com/ansible-collections/community.general/pull/4567).
- profitbricks - minor refactoring (https://github.com/ansible-collections/community.general/pull/4567).
- smartos_image_info - minor refactoring (https://github.com/ansible-collections/community.general/pull/4567).
- vmadm - minor refactoring (https://github.com/ansible-collections/community.general/pull/4567).
- webfaction_app - minor refactoring (https://github.com/ansible-collections/community.general/pull/4567).
- webfaction_db - minor refactoring (https://github.com/ansible-collections/community.general/pull/4567).
- nomad_job - minor refactoring (https://github.com/ansible-collections/community.general/pull/4567).
- nomad_job_info - minor refactoring (https://github.com/ansible-collections/community.general/pull/4567).
4 changes: 2 additions & 2 deletions plugins/modules/cloud/atomic/atomic_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ def core(module):
def main():
module = AnsibleModule(
argument_spec=dict(
mode=dict(default=None, choices=['user', 'system']),
mode=dict(choices=['user', 'system']),
name=dict(required=True),
image=dict(required=True),
rootfs=dict(default=None),
rootfs=dict(),
state=dict(default='latest', choices=['present', 'absent', 'latest', 'rollback']),
backend=dict(required=True, choices=['docker', 'ostree']),
values=dict(type='list', default=[], elements='str'),
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/cloud/misc/proxmox.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ def main():
force=dict(type='bool', default=False),
purge=dict(type='bool', default=False),
state=dict(default='present', choices=['present', 'absent', 'stopped', 'started', 'restarted']),
pubkey=dict(type='str', default=None),
pubkey=dict(type='str'),
unprivileged=dict(type='bool', default=False),
description=dict(type='str'),
hookscript=dict(type='str'),
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/cloud/packet/packet_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ def main():
plan=dict(),
project_id=dict(required=True),
state=dict(choices=ALLOWED_STATES, default='present'),
user_data=dict(default=None),
user_data=dict(),
wait_for_public_IPv=dict(type='int', choices=[4, 6]),
wait_timeout=dict(type='int', default=900),
ipxe_script_url=dict(default=''),
Expand Down
10 changes: 5 additions & 5 deletions plugins/modules/cloud/packet/packet_sshkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,11 @@ def main():
state=dict(choices=['present', 'absent'], default='present'),
auth_token=dict(default=os.environ.get(PACKET_API_TOKEN_ENV_VAR),
no_log=True),
label=dict(type='str', aliases=['name'], default=None),
id=dict(type='str', default=None),
fingerprint=dict(type='str', default=None),
key=dict(type='str', default=None, no_log=True),
key_file=dict(type='path', default=None),
label=dict(type='str', aliases=['name']),
id=dict(type='str'),
fingerprint=dict(type='str'),
key=dict(type='str', no_log=True),
key_file=dict(type='path'),
),
mutually_exclusive=[
('label', 'id'),
Expand Down
8 changes: 4 additions & 4 deletions plugins/modules/cloud/packet/packet_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ def act_on_volume(target_state, module, packet_conn):
def main():
module = AnsibleModule(
argument_spec=dict(
id=dict(type='str', default=None),
description=dict(type="str", default=None),
name=dict(type='str', default=None),
id=dict(type='str'),
description=dict(type="str"),
name=dict(type='str'),
state=dict(choices=VOLUME_STATES, default="present"),
auth_token=dict(
type='str',
Expand All @@ -277,7 +277,7 @@ def main():
facility=dict(type="str"),
size=dict(type="int"),
locked=dict(type="bool", default=False),
snapshot_policy=dict(type='dict', default=None),
snapshot_policy=dict(type='dict'),
billing_cycle=dict(type='str', choices=BILLING, default="hourly"),
),
supports_check_mode=True,
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/cloud/profitbricks/profitbricks.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ def main():
default='AMD_OPTERON'),
volume_size=dict(type='int', default=10),
disk_type=dict(choices=['HDD', 'SSD'], default='HDD'),
image_password=dict(default=None, no_log=True),
image_password=dict(no_log=True),
ssh_keys=dict(type='list', elements='str', default=[], no_log=False),
bus=dict(choices=['VIRTIO', 'IDE'], default='VIRTIO'),
lan=dict(type='int', default=1),
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/cloud/smartos/smartos_image_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def return_all_installed_images(self):
def main():
module = AnsibleModule(
argument_spec=dict(
filters=dict(default=None),
filters=dict(),
),
supports_check_mode=True,
)
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/cloud/smartos/vmadm.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ def main():
choices=['present', 'running', 'absent', 'deleted', 'stopped', 'created', 'restarted', 'rebooted']
),
name=dict(
default=None, type='str',
type='str',
aliases=['alias']
),
brand=dict(
Expand All @@ -709,7 +709,7 @@ def main():
# Add our 'simple' options to options dict.
for type in properties:
for p in properties[type]:
option = dict(default=None, type=type)
option = dict(type=type)
options[p] = option

module = AnsibleModule(
Expand Down
10 changes: 5 additions & 5 deletions plugins/modules/cloud/webfaction/webfaction_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ def main():
module = AnsibleModule(
argument_spec=dict(
name=dict(required=True),
state=dict(required=False, choices=['present', 'absent'], default='present'),
state=dict(choices=['present', 'absent'], default='present'),
type=dict(required=True),
autostart=dict(required=False, type='bool', default=False),
extra_info=dict(required=False, default=""),
port_open=dict(required=False, type='bool', default=False),
autostart=dict(type='bool', default=False),
extra_info=dict(default=""),
port_open=dict(type='bool', default=False),
login_name=dict(required=True),
login_password=dict(required=True, no_log=True),
machine=dict(required=False, default=None),
machine=dict(),
),
supports_check_mode=True
)
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/cloud/webfaction/webfaction_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ def main():
module = AnsibleModule(
argument_spec=dict(
name=dict(required=True),
state=dict(required=False, choices=['present', 'absent'], default='present'),
state=dict(choices=['present', 'absent'], default='present'),
# You can specify an IP address or hostname.
type=dict(required=True, choices=['mysql', 'postgresql']),
password=dict(required=False, default=None, no_log=True),
password=dict(no_log=True),
login_name=dict(required=True),
login_password=dict(required=True, no_log=True),
machine=dict(required=False, default=None),
machine=dict(),
),
supports_check_mode=True
)
Expand Down
12 changes: 6 additions & 6 deletions plugins/modules/clustering/nomad/nomad_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ def run():
use_ssl=dict(type='bool', default=True),
timeout=dict(type='int', default=5),
validate_certs=dict(type='bool', default=True),
client_cert=dict(type='path', default=None),
client_key=dict(type='path', default=None),
namespace=dict(type='str', default=None),
name=dict(type='str', default=None),
client_cert=dict(type='path'),
client_key=dict(type='path'),
namespace=dict(type='str'),
name=dict(type='str'),
content_format=dict(choices=['hcl', 'json'], default='hcl'),
content=dict(type='str', default=None),
content=dict(type='str'),
force_start=dict(type='bool', default=False),
token=dict(type='str', default=None, no_log=True)
token=dict(type='str', no_log=True)
),
supports_check_mode=True,
mutually_exclusive=[
Expand Down
10 changes: 5 additions & 5 deletions plugins/modules/clustering/nomad/nomad_job_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,11 @@ def run():
use_ssl=dict(type='bool', default=True),
timeout=dict(type='int', default=5),
validate_certs=dict(type='bool', default=True),
client_cert=dict(type='path', default=None),
client_key=dict(type='path', default=None),
namespace=dict(type='str', default=None),
name=dict(type='str', default=None),
token=dict(type='str', default=None, no_log=True)
client_cert=dict(type='path'),
client_key=dict(type='path'),
namespace=dict(type='str'),
name=dict(type='str'),
token=dict(type='str', no_log=True)
),
supports_check_mode=True
)
Expand Down

0 comments on commit 580fafb

Please sign in to comment.