Fixing nxos_vlan to match platform agnostic net_vlan part2 (#32410)

* adding active and suspend to state to match net_vlan module

although this is backwards compatible (for now)

* removing bad config

* getting rid of bad yml syntax
pull/32428/head
Sean Cavanaugh 7 years ago committed by Trishna Guha
parent d7c8fdbd79
commit 1068aa3ce7

@ -48,7 +48,7 @@ options:
vlan_state:
description:
- Manage the vlan operational state of the VLAN
(equivalent to state {active | suspend} command.
This is being deprecated in favor of state.
required: false
default: active
choices: ['active','suspend']
@ -69,9 +69,10 @@ options:
state:
description:
- Manage the state of the resource.
Active and Suspend will assume the vlan is present.
required: false
default: present
choices: ['present','absent']
choices: ['present','absent', 'active', 'suspend']
mode:
description:
- Set VLAN mode to classical ethernet or fabricpath.
@ -286,9 +287,10 @@ def main():
name=dict(required=False),
vlan_state=dict(choices=['active', 'suspend'], required=False),
mapped_vni=dict(required=False, type='str'),
state=dict(choices=['present', 'absent'], default='present', required=False),
state=dict(choices=['present', 'absent', 'active', 'suspend'], default='present', required=False),
admin_state=dict(choices=['up', 'down'], required=False),
mode=dict(choices=['ce', 'fabricpath'], required=False),
)
argument_spec.update(nxos_argument_spec)
@ -309,6 +311,13 @@ def main():
admin_state = module.params['admin_state']
mapped_vni = module.params['mapped_vni']
state = module.params['state']
# this allows vlan_state to remain backwards compatible as we move towards
# pushing all 4 options into state to match net_vlan
if state == 'active' or state == 'suspend':
vlan_state = module.params['state']
state = 'present'
mode = module.params['mode']
if vlan_id:

Loading…
Cancel
Save