Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix nxos_vlan mode idempotence bug #55144

Merged
merged 2 commits into from
May 8, 2019

Conversation

trishnaguha
Copy link
Member

Signed-off-by: Trishna Guha trishnaguha17@gmail.com

SUMMARY

fixes #53887

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

modules/network/nxos/nxos_vlan.py

@ansibot
Copy link
Contributor

ansibot commented Apr 11, 2019

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. cisco Cisco technologies module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. needs_triage Needs a first human triage before being processed. networking Network category nxos Cisco NXOS community owner_pr This PR is made by the module's maintainer. support:network This issue/PR relates to code supported by the Ansible Network Team. labels Apr 11, 2019
@trishnaguha trishnaguha force-pushed the nxos_vlan_mode_idempotence branch 2 times, most recently from 269ebce to 2c0e33c Compare April 12, 2019 06:19
@ansibot
Copy link
Contributor

ansibot commented Apr 12, 2019

@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. owner_pr This PR is made by the module's maintainer. labels Apr 12, 2019
@trishnaguha trishnaguha removed the needs_triage Needs a first human triage before being processed. label Apr 17, 2019
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Apr 25, 2019
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. core_review In order to be merged, this PR must follow the core review workflow. labels May 7, 2019
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels May 7, 2019
@trishnaguha trishnaguha merged commit 57e0567 into ansible:devel May 8, 2019
@trishnaguha trishnaguha self-assigned this May 8, 2019
@trishnaguha trishnaguha deleted the nxos_vlan_mode_idempotence branch May 8, 2019 05:49
trishnaguha added a commit to trishnaguha/ansible that referenced this pull request May 8, 2019
* fix nxos_vlan mode idempotence bug

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Fix CI failure

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 57e0567)
abadger pushed a commit that referenced this pull request May 21, 2019
* nxos_vlan: vlan names containing regex ctl chars should be escaped (#55463)

The `nxos_vlan` module may raise with regex error `sre_constants.error: multiple repeat` in the non_structured codepath if the device has existing vlan names with certain regex control characters; e.g.

```
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Eth1/3
14   my-vlan-name-is-***              active
```

(cherry picked from commit de8ce08)

* fix nxos_vlan mode idempotence bug (#55144)

* fix nxos_vlan mode idempotence bug

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Fix CI failure

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 57e0567)

* nxos_vlan fix 2.8 backport

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
chrisvanheuveln added a commit to chrisvanheuveln/ansible that referenced this pull request May 31, 2019
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 ansible#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.
StephenSorriaux pushed a commit to StephenSorriaux/ansible that referenced this pull request Jun 4, 2019
…7229)

* nxos_vlan: fix broken purge behavior (issue ansible#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 ansible#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
trishnaguha pushed a commit to trishnaguha/ansible that referenced this pull request Jun 6, 2019
…7229)

* nxos_vlan: fix broken purge behavior (issue ansible#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 ansible#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 6bb13bb)
abadger pushed a commit that referenced this pull request Jun 12, 2019
* 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 6bb13bb)

* changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
@ansible ansible locked and limited conversation to collaborators Aug 5, 2019
bcoca pushed a commit to bcoca/ansible that referenced this pull request Feb 21, 2020
…7229)

* nxos_vlan: fix broken purge behavior (issue ansible#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 ansible#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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. cisco Cisco technologies core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. networking Network category nxos Cisco NXOS community support:core This issue/PR relates to code supported by the Ansible Engineering Team. support:network This issue/PR relates to code supported by the Ansible Network Team. test This PR relates to tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nxos_vlan: idempotency bug with mode
2 participants