cisco.nxos
cisco.nxos copied to clipboard
nxos_ospf_interfaces exception while sorting interfaces
Summary Trying to use nxos_ospf_interfaces on an N9k, facts gathering fails at line 78 in populate_facts, in facts/ospf_interfaces/ospf_interfaces.py with exception '<' not supported between instances of 'str' and 'int'. The function is using sorted with a lambda function that attempts to split the interface name by '/' and convert digits to integers, however, I suspect this is failing when sub-interfaces exist in the list, as isdigit returns false with a string like "1.6" but I'm not sure.
Issue Type Bug Report
Component Name plugins/module_utils/network/nxos/facts/ospf_interfaces/ospf_interfaces.py
Ansible Version It's difficult for me to move large amounts of text out of our environments, but we are running
5.7.1 community Configuration
if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all It's difficult for me to move large amounts of text out of our environments OS / Environment We're using 0.5.0 of the AWX execution environment (customized with the above version of ansible community).
Steps to Reproduce Any invocation of a task using nxos_ospf_interfaces on this particular host results in this error.
The host is a N9k, running nxos 9.3(9)
Expected Results I expect the module to configure ospf interfaces.
Actual Results
Facts gathering fails at line 78 in populate_facts, in facts/ospf_interfaces/ospf_interfaces.py with exception '<' not supported between instances of 'str' and 'int'
.
Code of Conduct
I agree to follow the Ansible Code of Conduct
@zendritic This has recently been fixed as a part of https://github.com/ansible-collections/cisco.nxos/pull/543. But a collection release hasn't been made with this patch yet. If you pull the latest changes from this repo, this issue should be fixed. Please let me know if that works for you. Thank you!
@zendritic This has recently been fixed as a part of #543. But a collection release hasn't been made with this patch yet. If you pull the latest changes from this repo, this issue should be fixed. Please let me know if that works for you. Thank you!
Thanks for your quick response. I'm only using the community version due to the fact that it's exceedingly difficult to manuall pull in collections in our environment. I'll probably end up waiting for this to make its way into community ansible and continue to use nxos_config until then.
@zendritic The v3.1.1 of cisco.nxos collection has been released. This will have the required fix for this issue. Hence, I'm closing this issue. Thank you!