You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Did a fresh install of napalm into a venv and ran get_interfaces against a Juniper device. Got some weird output. Stripped down code for testing:
from napalm.junos import JunOSDriver
from pprint import pprint
test_host = JunOSDriver(<details redacted>)
test_host.open()
pprint(test_host.get_interfaces())
test_host.close()
Here is the resulting error:
Traceback (most recent call last):
File "/home/amylieb/src/sph-audit/test.py", line 6, in <module>
pprint(test_host.get_interfaces())
File "/home/amylieb/src/sph-audit/venv/lib/python3.10/site-packages/napalm/junos/junos.py", line 481, in get_interfaces
result = _convert_to_dict(interfaces)
File "/home/amylieb/src/sph-audit/venv/lib/python3.10/site-packages/napalm/junos/junos.py", line 438, in _convert_to_dict
"is_up": iface_data["is_up"],
TypeError: 'NoneType' object is not subscriptable
I went into the source code for the Junos driver and added print(dict(interfaces)) after line 472 to see what junos views gave me, here's what that looks like:
This getter has worked just fine for me in the past, so the first thing I tried was to downgrade junos-eznc from 2.7.2 to 2.7.1 and everything works fine.
Because I was curious, I ran all the getters against my test device (An EX3400-48P running 20.4R3-S1.3) with junos-eznc at 2.7.2 and 2.7.1. Below are the ones that failed (by that I mean threw an exception) at 2.7.2 that did not at 2.7.1:
get_interfaces
get_network_instances
get_route_to
I glanced through the open issues on the pyEZ repo and didn't see anything obvious. I don't really have the time/interest to dig deep enough to open a detailed issue with them, but I want to give you guys a heads up about it - at the very least you can potentially update your requirements file.
The text was updated successfully, but these errors were encountered:
amylieb
changed the title
junos get_interfaces broken with junos-eznc 2.7.2
some junos getters broken with junos-eznc 2.7.2
Dec 2, 2024
Looks like someone saw this issue and created a corresponding one in the junos-eznc repo, with a potential fix slated for 2.7.3. Juniper/py-junos-eznc#1354
If updating requirements.txt counts as a fix I'd be happy to submit a PR - just need privileges to create a branch.
Description of Issue/Question
Did a fresh install of napalm into a venv and ran
get_interfaces
against a Juniper device. Got some weird output. Stripped down code for testing:Here is the resulting error:
I went into the source code for the Junos driver and added
print(dict(interfaces))
after line 472 to see what junos views gave me, here's what that looks like:This getter has worked just fine for me in the past, so the first thing I tried was to downgrade junos-eznc from 2.7.2 to 2.7.1 and everything works fine.
Because I was curious, I ran all the getters against my test device (An EX3400-48P running 20.4R3-S1.3) with junos-eznc at 2.7.2 and 2.7.1. Below are the ones that failed (by that I mean threw an exception) at 2.7.2 that did not at 2.7.1:
get_interfaces
get_network_instances
get_route_to
I glanced through the open issues on the pyEZ repo and didn't see anything obvious. I don't really have the time/interest to dig deep enough to open a detailed issue with them, but I want to give you guys a heads up about it - at the very least you can potentially update your requirements file.
The text was updated successfully, but these errors were encountered: