mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-08 01:14:03 -07:00
Eliminate redundant module argument checks.
This commit is contained in:
parent
6b753c5c71
commit
23c79ed474
5 changed files with 4 additions and 47 deletions
|
@ -83,8 +83,6 @@ except ImportError:
|
|||
|
||||
def cloud_monitoring(module, state, label, agent_id, named_ip_addresses,
|
||||
metadata):
|
||||
if not label:
|
||||
module.fail_json(msg='label is required for rax_mon_entity')
|
||||
|
||||
if len(label) < 1 or len(label) > 255:
|
||||
module.fail_json(msg='label must be between 1 and 255 characters long')
|
||||
|
@ -139,13 +137,11 @@ def cloud_monitoring(module, state, label, agent_id, named_ip_addresses,
|
|||
ip_addresses=named_ip_addresses,
|
||||
metadata=metadata)
|
||||
changed = True
|
||||
elif state == 'absent':
|
||||
else:
|
||||
# Delete the existing Entities.
|
||||
for e in existing:
|
||||
e.delete()
|
||||
changed = True
|
||||
else:
|
||||
module.fail_json(msg='state must be present or absent')
|
||||
|
||||
if entity:
|
||||
entity_dict = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue