-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
nxos_linkagg: group
type mismatch causes idempotency failure
#53653
Conversation
* `group` values need to be cast; e.g. ``` want = {'group': '20'} have = {'group': 20} ``` * Found with N7K `sanity` test
@@ -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): |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
* 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)
SUMMARY
group
values need to be cast; e.g.sanity
testISSUE TYPE
COMPONENT NAME
nxos_linkagg