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
The get_bgp_method() fails for Arista EOS version 4.28.5M. I dug into the code, and found what the Problem is.
This is because the show command used to gather the information from the Arista box now returns additional lines compared to the older EOS Versions.
See below output from the command : show ip bgp neighbors vrf all | include remote AS | remote router ID |IPv[46] (Unicast|6PE):.*[0-9]+|^Local AS|Desc|BGP state
Sample old version output:
BGP neighbor is 23.x.x.1, remote AS 20006, internal link
Description: Hostname_1
BGP version 4, remote router ID 23.x.x.x, VRF default
BGP state is Established, up for 298d22h
IPv4 Unicast: 1 9 2 0
IPv6 Unicast: 0 0 0 0
Local AS is 20006, local router ID 66.x.x.x
Sample output from Newer versions: -> Notice this now has additional Lines IPv4 and IPv6 Unicast (last 2 lines)
BGP neighbor is 54.x.x.106, remote AS 20006, internal link
Description: Host_2
BGP version 4, remote router ID 100.x.x.x, VRF default
BGP state is Established, up for 13d05h
IPv4 Unicast: 881093 0 0 0
IPv6 Unicast: 155144 0 0 0
Local AS is 2906, local router ID 66.x.x.x
IPv4 Unicast: 66.x.x.x
IPv6 Unicast: 2a00:x::x
To fix the issue I basically added about 5 lines of code in the eos.py as shown below in my local environment to Pop those lines from the List if they exist.
def get_bgp_neighbors(self):
<SNIP>
v4_stats = re.match(self._RE_BGP_PREFIX, lines.pop(0))
v6_stats = re.match(self._RE_BGP_PREFIX, lines.pop(0))
local_as = re.match(self._RE_BGP_LOCAL, lines.pop(0))
# newer version, show commands have IPV4 UNicast in them
if lines: #my code
if " IPv4 Unicast:" in lines[0]: # my code
lines.pop(0) # my code
if " IPv6 Unicast:" in lines[0]: # my code
lines.pop(0) # my code
data = {
"remote_as": napalm.base.helpers.as_number(neighbor_info.group("as")),
"remote_id": napalm.base.helpers.ip(
get_re_group(rid_info, "rid", "0.0.0.0")
(Paste the complete traceback of the exception between quotes below)
"/Users/firene/git/mpls_backbone/./mpls_backbone_router.py", line 422, in get_snapshot
bgp_neigh = device_conn.get_bgp_neighbors()
File "/Users/firene/git/mpls_backbone/venv/lib/python3.9/site-packages/napalm/eos/eos.py", line 748, in get_bgp_neighbors
"remote_as": napalm.base.helpers.as_number(neighbor_info.group("as")),
AttributeError: 'NoneType' object has no attribute 'group'
The text was updated successfully, but these errors were encountered:
Description of Issue/Question
The get_bgp_method() fails for Arista EOS version
4.28.5M
. I dug into the code, and found what the Problem is.This is because the show command used to gather the information from the Arista box now returns additional lines compared to the older EOS Versions.
See below output from the command :
show ip bgp neighbors vrf all | include remote AS | remote router ID |IPv[46] (Unicast|6PE):.*[0-9]+|^Local AS|Desc|BGP state
Sample old version output:
Sample output from Newer versions: -> Notice this now has additional Lines IPv4 and IPv6 Unicast (last 2 lines)
To fix the issue I basically added about 5 lines of code in the
eos.py
as shown below in my local environment to Pop those lines from the List if they exist.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
Error Traceback
(Paste the complete traceback of the exception between quotes below)
The text was updated successfully, but these errors were encountered: