Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--------------------------------------------------------------------------------
Fix
--------------------------------------------------------------------------------
* NXOS
* Modified ShowBgpVrfAllAllSummary:
* Handle cases where BGP neighbor information is spread over 3 lines
27 changes: 27 additions & 0 deletions src/genie/libs/parser/nxos/show_bgp_vrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1959,6 +1959,12 @@ def cli(self, vrf='all', address_family='all', output=None):
r' +(?P<tbl_ver>[0-9]+) +(?P<inq>[0-9]+)'
r' +(?P<outq>[0-9]+) +(?P<up_down>[a-zA-Z0-9\:]+)'
r' +(?P<state_pfxrcd>(?P<state>[a-zA-Z\s\(\)]+)?(?P<prx_rcd>\d+)?([\w\(\)\s]+)?)$')
#Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
# 1670:92:e000:24:2000::3
# 4 4110507001
# 0 0 0 0 0 2w1d Active
p8_2a = re.compile(r'^\s*(?P<v>[0-9]+) +(?P<as>[0-9]+)$')

# Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
# 10.10.10.10 4 4211111111
p8_3 = re.compile(r'^\s*(?P<neighbor>[a-zA-Z0-9\.\:]+) +(?P<v>[0-9]+) +(?P<as>[0-9]+)$')
Expand Down Expand Up @@ -2210,6 +2216,27 @@ def cli(self, vrf='all', address_family='all', output=None):
nbr_af_dict['path']['memory_usage'] = memory_usage
continue

# Neighbor information is spread over three lines:
#Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
# 1670:92:e000:24:2000::3
# 4 4110507001
# 0 0 0 0 0 2w1d Active
m = p8_2a.match(line)
if m and data_on_nextline:
# Note that we are not clearing data_on_nextline, the 3rd
# line will be matched by the existing p8_4 logic and cleared there
# Add address family to this neighbor
if 'address_family' not in nbr_dict:
nbr_dict['address_family'] = {}
if address_family not in nbr_dict['address_family']:
nbr_dict['address_family'][address_family] = {}
nbr_af_dict = nbr_dict['address_family'][address_family]

# Add keys for this address_family
nbr_af_dict['neighbor_table_version'] = int(m.groupdict()['v'])
nbr_af_dict['as'] = int(m.groupdict()['as'])
continue

# Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
# 10.10.10.10 4 4211111111
m = p8_3.match(line)
Expand Down
Loading