mirror of https://github.com/ansible/ansible.git
nxos_vlan purge fix 2.8 (#57442)
* nxos_vlan: fix broken purge behavior (issue #57101) (#57229)
* nxos_vlan: fix broken purge behavior (issue #57101)
Symptoms/Analysis:
- `nxos_vlan` `purge: true` would fail when `purge` was trying to delete all unspecified vlans, including vlan 1.
- `nxos` devices do not allow removing vlan 1 and raise a cli exception error
- Previous fix #55144 caused a side effect when `purge` was used: vlan changes specified by `aggregate` were ignored; e.g.
- vlan 4 is not present; playbook specifies `aggregate: { vlan: 4 }, purge: true`
- results in proper purging but vlan 4 is not created
Solutions:
- ignore vlan 1 when purging
- remove the `not purge` check from state present logic
Added additional unit tests and integration tests.
Tested against all regression platforms.
* PEP fixes
* Add agg_show_vlan_brief.txt fixture
* Add warning for removing vlan 1
* change method name check
(cherry picked from commit 6bb13bbb84)
* changelog
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
pull/57742/head
parent
769cc117a7
commit
30aba1a7fd
@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- nxos_vlan fix broken purge behavior (https://github.com/ansible/ansible/pull/57229).
|
||||
@ -0,0 +1,27 @@
|
||||
{
|
||||
"TABLE_vlanbriefxbrief": {
|
||||
"ROW_vlanbriefxbrief": [
|
||||
{
|
||||
"vlanshowbr-vlanid": 1,
|
||||
"vlanshowbr-vlanid-utf": 1,
|
||||
"vlanshowbr-vlanname": "default",
|
||||
"vlanshowbr-vlanstate": "active",
|
||||
"vlanshowbr-shutstate": "noshutdown"
|
||||
},
|
||||
{
|
||||
"vlanshowbr-vlanid": 4,
|
||||
"vlanshowbr-vlanid-utf": 4,
|
||||
"vlanshowbr-vlanname": "_4_",
|
||||
"vlanshowbr-vlanstate": "active",
|
||||
"vlanshowbr-shutstate": "noshutdown"
|
||||
},
|
||||
{
|
||||
"vlanshowbr-vlanid": 5,
|
||||
"vlanshowbr-vlanid-utf": 5,
|
||||
"vlanshowbr-vlanname": "_5_",
|
||||
"vlanshowbr-vlanstate": "active",
|
||||
"vlanshowbr-shutstate": "noshutdown"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue