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

nxos_linkagg: group type mismatch causes idempotency failure #53653

Merged
merged 2 commits into from
Mar 13, 2019

Conversation

chrisvanheuveln
Copy link
Contributor

SUMMARY
  • group values need to be cast; e.g.
 want = {'group': '20'}
 have = {'group': 20}
  • Found with N7K sanity test
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

nxos_linkagg

* `group` values need to be cast; e.g.

```
 want = {'group': '20'}
 have = {'group': 20}
```

* Found with N7K `sanity` test
@ansibot
Copy link
Contributor

ansibot commented Mar 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 core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. 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. small_patch support:network This issue/PR relates to code supported by the Ansible Network Team. labels Mar 11, 2019
@@ -135,7 +135,7 @@

def search_obj_in_list(group, lst):
for o in lst:
if o['group'] == group:
if str(o['group']) == str(group):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is because of https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/network/nxos/nxos_linkagg.py#L267. We did it because some of the platforms/versions return group as str.

Instead of masking it here, I would rather change the type of group param to str https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/network/nxos/nxos_linkagg.py#L375 and make sure the that the group info we fetch from the device is string format obj['group'] = str(group) https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/network/nxos/nxos_linkagg.py#L337

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I'll change and retest.

@trishnaguha trishnaguha self-assigned this Mar 12, 2019
@trishnaguha trishnaguha removed the needs_triage Needs a first human triage before being processed. label Mar 12, 2019
@trishnaguha trishnaguha merged commit 66fe6bf into ansible:devel Mar 13, 2019
trishnaguha pushed a commit to trishnaguha/ansible that referenced this pull request Apr 1, 2019
…le#53653)

* nxos_linkagg: `group` type mismatch causes idempotency failure

* `group` values need to be cast; e.g.

```
 want = {'group': '20'}
 have = {'group': 20}
```

* Found with N7K `sanity` test

* nxos_linkagg: change group param type to str

(cherry picked from commit 66fe6bf)
abadger pushed a commit that referenced this pull request Apr 4, 2019
* nxos_linkagg: `group` type mismatch causes idempotency failure

* `group` values need to be cast; e.g.

```
 want = {'group': '20'}
 have = {'group': 20}
```

* Found with N7K `sanity` test

* nxos_linkagg: change group param type to str

(cherry picked from commit 66fe6bf)
@chrisvanheuveln chrisvanheuveln deleted the devel-nxos_linkagg branch April 18, 2019 18:01
@ansible ansible locked and limited conversation to collaborators Jul 25, 2019
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 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants