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

Junos get_bgp_config() issue with route reflector clients #1753

Closed
1 task done
jtishey opened this issue Sep 14, 2022 · 2 comments
Closed
1 task done

Junos get_bgp_config() issue with route reflector clients #1753

jtishey opened this issue Sep 14, 2022 · 2 comments

Comments

@jtishey
Copy link
Contributor

jtishey commented Sep 14, 2022

Junos get_bgp_config() fails when a value is present in neighbor data for "cluster". This raises an exception in helpers.convert, as a None datatype is passed in for "to". If I add "cluster": str to _COMMON_FIELDS_DATATYPE_ in napalm/junos.py it does seem to work as expected.

Did you follow the steps from https://github.com/napalm-automation/napalm#faq

(Place an x between the square brackets where applicable)

  • Yes
  • [] No

Setup

napalm version

(Paste verbatim output from pip freeze | grep napalm between quotes below)

napalm==4.0.0

Network operating system version

(Paste verbatim output from show version - or equivalent - between quotes below)

Hostname: router1
Model: mx960
Junos: 20.4R3-S2.6
JUNOS OS Kernel 64-bit  [20211117.c779bdc_builder_stable_11-204ab]
JUNOS OS libs [20211117.c779bdc_builder_stable_11-204ab]
JUNOS OS runtime [20211117.c779bdc_builder_stable_11-204ab]
JUNOS OS time zone information [20211117.c779bdc_builder_stable_11-204ab]
JUNOS network stack and utilities [20220206.163424_builder_junos_204_r3_s2]
JUNOS libs [20220206.163424_builder_junos_204_r3_s2]
JUNOS OS libs compat32 [20211117.c779bdc_builder_stable_11-204ab]
JUNOS OS 32-bit compatibility [20211117.c779bdc_builder_stable_11-204ab]
JUNOS libs compat32 [20220206.163424_builder_junos_204_r3_s2]
JUNOS runtime [20220206.163424_builder_junos_204_r3_s2]
JUNOS sflow mx [20220206.163424_builder_junos_204_r3_s2]
JUNOS py extensions2 [20220206.163424_builder_junos_204_r3_s2]
JUNOS py extensions [20220206.163424_builder_junos_204_r3_s2]
JUNOS py base2 [20220206.163424_builder_junos_204_r3_s2]
JUNOS py base [20220206.163424_builder_junos_204_r3_s2]
JUNOS OS crypto [20211117.c779bdc_builder_stable_11-204ab]
JUNOS OS boot-ve files [20211117.c779bdc_builder_stable_11-204ab]
JUNOS na telemetry [20.4R3-S2.6]
JUNOS Security Intelligence [20220206.163424_builder_junos_204_r3_s2]
JUNOS mx libs compat32 [20220206.163424_builder_junos_204_r3_s2]
JUNOS mx runtime [20220206.163424_builder_junos_204_r3_s2]
JUNOS RPD Telemetry Application [20.4R3-S2.6]
Redis [20220206.163424_builder_junos_204_r3_s2]
JUNOS probe utility [20220206.163424_builder_junos_204_r3_s2]
JUNOS common platform support [20220206.163424_builder_junos_204_r3_s2]
JUNOS Openconfig [20.4R3-S2.6]
JUNOS mtx network modules [20220206.163424_builder_junos_204_r3_s2]
JUNOS modules [20220206.163424_builder_junos_204_r3_s2]
JUNOS mx modules [20220206.163424_builder_junos_204_r3_s2]
JUNOS mx libs [20220206.163424_builder_junos_204_r3_s2]
JUNOS SQL Sync Daemon [20220206.163424_builder_junos_204_r3_s2]
JUNOS mtx Data Plane Crypto Support [20220206.163424_builder_junos_204_r3_s2]
JUNOS daemons [20220206.163424_builder_junos_204_r3_s2]
JUNOS mx daemons [20220206.163424_builder_junos_204_r3_s2]
JUNOS Broadband Egde User Plane Apps [20.4R3-S2.6]
JUNOS appidd-mx application-identification daemon [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services URL Filter package [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services TLB Service PIC package [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services Telemetry [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services TCP-LOG [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services SSL [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services SOFTWIRE [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services Stateful Firewall [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services RTCOM [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services RPM [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services PCEF package [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services NAT [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services Mobile Subscriber Service Container package [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services MobileNext Software package [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services Logging Report Framework package [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services LL-PDF Container package [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services Jflow Container package [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services Deep Packet Inspection package [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services IPSec [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services IDS [20220206.163424_builder_junos_204_r3_s2]
JUNOS IDP Services [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services HTTP Content Management package [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services Crypto [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services Captive Portal and Content Delivery Container package [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services COS [20220206.163424_builder_junos_204_r3_s2]
JUNOS AppId Services [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services Application Level Gateways [20220206.163424_builder_junos_204_r3_s2]
JUNOS Services AACL Container package [20220206.163424_builder_junos_204_r3_s2]
JUNOS SDN Software Suite [20220206.163424_builder_junos_204_r3_s2]
JUNOS Extension Toolkit [20220206.163424_builder_junos_204_r3_s2]
JUNOS Packet Forwarding Engine Support (wrlinux9) [20220206.163424_builder_junos_204_r3_s2]
JUNOS Packet Forwarding Engine Support (MXSPC3) [20.4R3-S2.6]
JUNOS Packet Forwarding Engine Support (MX/EX92XX Common) [20220206.163424_builder_junos_204_r3_s2]
JUNOS Packet Forwarding Engine Support (M/T Common) [20220206.163424_builder_junos_204_r3_s2]
JUNOS Packet Forwarding Engine Support (aft) [20220206.163424_builder_junos_204_r3_s2]
JUNOS Packet Forwarding Engine Support (MX Common) [20220206.163424_builder_junos_204_r3_s2]
JUNOS Juniper Malware Removal Tool (JMRT) [1.0.0+20220206.163424_builder_junos_204_r3_s2]
JUNOS J-Insight [20220206.163424_builder_junos_204_r3_s2]
JUNOS jfirmware [20220206.163424_builder_junos_204_r3_s2]
JUNOS Online Documentation [20220206.163424_builder_junos_204_r3_s2]
JUNOS jail runtime [20211117.c779bdc_builder_stable_11-204ab]

Steps to Reproduce the Issue

from napalm import get_network_driver
import json
auth_info = {"username": "user", "password": "pass"}
d = "router1"
dev_os = "junos"
driver = get_network_driver(dev_os)
dev = driver(d, auth_info["username"], auth_info["password"])
dev.open()

bgp_config = dev.get_bgp_config()
print(json.dumps(bgp_config, indent=2))

Error Traceback

(Paste the complete traceback of the exception between quotes below)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/napalm_test/env/lib/python3.9/site-packages/napalm/junos/junos.py", line 1304, in get_bgp_config
    {key: napalm.base.helpers.convert(datatype, value, default)}
  File "/napalm_test/env/lib/python3.9/site-packages/napalm/base/helpers.py", line 464, in convert
    raise ValueError(
ValueError: Can't convert with callable None - no default is defined for this type.
@jtishey
Copy link
Contributor Author

jtishey commented Sep 29, 2022

Ran into a similar issue with a group config failing to handle multihop key. Looking for a better way to handle these.

@maheshwarreddy96
Copy link

It works fine with napalm 3.4.1 but doesn't work with the latest version.

mirceaulinic added a commit that referenced this issue Mar 21, 2024
JUNOS get_bgp_config() - ValueError: Can't convert with callable None (Fix #1753)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants