Open smaxx1337 opened 4 years ago
FYI: I have tried to "quickfix" it by adding this on line 375 in "napalm/base/helpers.py":
return int(as_number_str) if as_number_str.isdigit() else None
However, got the next error then:
Traceback (most recent call last):
File "napalm_test.py", line 18, in <module>
a = device.get_bgp_neighbors_detail()
File "/usr/lib/python3.6/site-packages/napalm/ios/ios.py", line 1913, in get_bgp_neighbors_detail
"remote_address": napalm.base.helpers.ip(bgp_neigh["neighbor"]),
File "/usr/lib/python3.6/site-packages/napalm/base/helpers.py", line 362, in ip
addr_obj = IPAddress(addr)
File "/usr/lib/python3.6/site-packages/netaddr/ip/__init__.py", line 306, in __init__
'address from %r' % addr)
netaddr.core.AddrFormatError: failed to detect a valid IP address from ''
@smaxx1337 the way I usually debug this sort of things is adding another test case for the impacted method (i.e., a new directory under https://github.com/napalm-automation/napalm/tree/develop/test/ios/mocked_data/test_get_bgp_neighbors_detail, say issue_1213
) where I dump the data that's causing the trouble. Then, I start crafting around that. tox
is your friend in this case. :-)
Feel free to open a PR with what you have so far (including the mock data), even if WIP, and maybe we can help / guide you. Cheers. :wink:
Description of Issue/Question
When we try to get a detailed view of the BGP neighbors by calling get_bgp_neighbors_detail(), we receive the error:
ValueError: invalid literal for int() with base 10: ''
However, get_bgp_neighbors() works fine.
Did you follow the steps from https://github.com/napalm-automation/napalm#faq
(Place an
x
between the square brackets where applicable)Setup
napalm version
(Paste verbatim output from
pip freeze | grep napalm
between quotes below)Network operating system version
(Paste verbatim output from
show version
- or equivalent - between quotes below)Steps to Reproduce the Issue
We used this code for testing:
Error Traceback
(Paste the complete traceback of the exception between quotes below)