mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-22 22:11:44 -07:00
Fix vyos_vlan aggregate issue & added tests (#41638)
* Fix vyos_vlan aggregate issue & Added tests * Fix #2 for vyos_vlan aggregate issue
This commit is contained in:
parent
7dcaef8115
commit
837c216587
2 changed files with 32 additions and 2 deletions
|
@ -185,6 +185,10 @@ def map_params_to_obj(module):
|
|||
item[key] = module.params[key]
|
||||
|
||||
d = item.copy()
|
||||
|
||||
if not d['vlan_id']:
|
||||
module.fail_json(msg='vlan_id is required')
|
||||
|
||||
d['vlan_id'] = str(d['vlan_id'])
|
||||
module._check_required_one_of(module.required_one_of, item)
|
||||
|
||||
|
@ -269,7 +273,7 @@ def main():
|
|||
""" main entry point for module execution
|
||||
"""
|
||||
element_spec = dict(
|
||||
vlan_id=dict(type='int', required=True),
|
||||
vlan_id=dict(type='int'),
|
||||
name=dict(),
|
||||
address=dict(),
|
||||
interfaces=dict(type='list'),
|
||||
|
@ -293,7 +297,7 @@ def main():
|
|||
argument_spec.update(vyos_argument_spec)
|
||||
|
||||
required_one_of = [['vlan_id', 'aggregate'],
|
||||
['interfaces', 'associated_interfaces']]
|
||||
['aggregate', 'interfaces', 'associated_interfaces']]
|
||||
|
||||
mutually_exclusive = [['vlan_id', 'aggregate']]
|
||||
module = AnsibleModule(argument_spec=argument_spec,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue