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

some junos getters broken with junos-eznc 2.7.2 #2154

Open
amylieb opened this issue Dec 2, 2024 · 5 comments
Open

some junos getters broken with junos-eznc 2.7.2 #2154

amylieb opened this issue Dec 2, 2024 · 5 comments
Labels

Comments

@amylieb
Copy link

amylieb commented Dec 2, 2024

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:

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:

{'ge-0/0/0': None, 'pfe-0/0/0': None, 'pfh-0/0/0': None, 'ge-0/0/1': None, 'ge-0/0/2': None, 'ge-0/0/3': None, 'ge-0/0/4': None, 'ge-0/0/5': None, 'ge-0/0/6': None, 'ge-0/0/7': None, 'ge-0/0/8': None, 'ge-0/0/9': None, 'ge-0/0/10': None, 'ge-0/0/11': None, 'ge-0/0/12': None, 'ge-0/0/13': None, 'ge-0/0/14': None, 'ge-0/0/15': None, 'ge-0/0/16': None, 'ge-0/0/17': None, 'ge-0/0/18': None, 'ge-0/0/19': None, 'ge-0/0/20': None, 'ge-0/0/21': None, 'ge-0/0/22': None, 'ge-0/0/23': None, 'ge-0/0/24': None, 'ge-0/0/25': None, 'ge-0/0/26': None, 'ge-0/0/27': None, 'ge-0/0/28': None, 'ge-0/0/29': None, 'ge-0/0/30': None, 'ge-0/0/31': None, 'ge-0/0/32': None, 'ge-0/0/33': None, 'ge-0/0/34': None, 'ge-0/0/35': None, 'ge-0/0/36': None, 'ge-0/0/37': None, 'ge-0/0/38': None, 'ge-0/0/39': None, 'ge-0/0/40': None, 'ge-0/0/41': None, 'ge-0/0/42': None, 'ge-0/0/43': None, 'ge-0/0/44': None, 'ge-0/0/45': None, 'ge-0/0/46': None, 'ge-0/0/47': None, 'xe-0/2/0': None, 'xe-0/2/1': None, 'ae0': None, 'bme0': None, 'cbp0': None, 'dsc': None, 'esi': None, 'gre': None, 'ipip': None, 'irb': None, 'jsrv': None, 'lo0': None, 'lsi': None, 'me0': None, 'mtun': None, 'pimd': None, 'pime': None, 'pip0': None, 'tap': None, 'vme': None, 'vtep': None}

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.

@amylieb 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
@ktbyers ktbyers added the bug label Dec 4, 2024
@ktbyers
Copy link
Contributor

ktbyers commented Dec 4, 2024

@amylieb Thanks for reporting this.

@Josephine-Rutten
Copy link

We encountered the same issue. Thanks for reporting it @amylieb. We will consider your temporarily solution of downgrading junos-eznc.

@misch42
Copy link

misch42 commented Dec 20, 2024

Same issue here.

@ktbyers
Copy link
Contributor

ktbyers commented Dec 20, 2024

Someone want to fix it?

@amylieb
Copy link
Author

amylieb commented Dec 22, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants