Skip to content

Commit

Permalink
Fix hp_comware_display_lldp_neighbor-information_list with production… (
Browse files Browse the repository at this point in the history
networktocode#1340)

* Fix hp_comware_display_lldp_neighbor-information_list with production outputs

* cosmetic
  • Loading branch information
dainok authored and cppmonkey committed Oct 25, 2023
1 parent 14b6b08 commit 6822ba1
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
Value Required LOCAL_INTERFACE (\S+)
Value Required CHASSIS_ID (\S+)
Value Required NEIGHBOR_INTERFACE (\S+)
Value Required NEIGHBOR_INTERFACE ((\S+)|(Port\s\d+))
Value Required NEIGHBOR (\S+)

Start
^.*Nearest\s+nontpmr\s+bridge\s+neighbor
^.*Nearest\s+customer\s+bridge\s+neighbor
^.*Nearest\s+bridge\s+neighbor
^System\s+Name
^\s*${NEIGHBOR}\s+${LOCAL_INTERFACE}\s+${CHASSIS_ID}\s+${NEIGHBOR_INTERFACE}\s*$$ -> Record Start
^System\s+Name -> Format1
^Local\s+Interface -> Format2
^. -> Error

Format1
^\s*${NEIGHBOR}\s+${LOCAL_INTERFACE}\s+${CHASSIS_ID}\s+${NEIGHBOR_INTERFACE}\s*$$ -> Record Format1
# Dropping long hostnames
^\s*\S+\s*$$
^. -> Error

Format2
^\s*${LOCAL_INTERFACE}\s+${CHASSIS_ID}\s+${NEIGHBOR_INTERFACE}\s+${NEIGHBOR}\s*$$ -> Record Format2
^. -> Error
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Chassis ID : * -- -- Nearest nontpmr bridge neighbor
# -- -- Nearest customer bridge neighbor
Default -- -- Nearest bridge neighbor
Local Interface Chassis ID Port ID System Name
XGE1/0/0/1 bcea-fa00-0033 Ten-GigabitEthernet1/0/47 SWITCH01
XGE1/0/0/2 bcea-fa00-0033 Ten-GigabitEthernet2/0/47 SWITCH01
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
parsed_sample:
- local_interface: "XGE1/0/0/1"
chassis_id: "bcea-fa00-0033"
neighbor_interface: "Ten-GigabitEthernet1/0/47"
neighbor: "SWITCH01"
- local_interface: "XGE1/0/0/2"
chassis_id: "bcea-fa00-0033"
neighbor_interface: "Ten-GigabitEthernet2/0/47"
neighbor: "SWITCH01"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
System Name Local Interface Chassis ID Port ID
SEP0000000000A0.exam GE1/0/24 10.1.2.3 AABBCCDDEEFF:P1
ple.com
SWITCH01 XGE1/0/29 bcea-fa00-0033 Ten-GigabitEthernet1/0/17
- GE2/0/45 SEP0000000000A0 Port 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
parsed_sample:
- local_interface: "GE1/0/24"
chassis_id: "10.1.2.3"
neighbor_interface: "AABBCCDDEEFF:P1"
neighbor: "SEP0000000000A0.exam"
- local_interface: "XGE1/0/29"
chassis_id: "bcea-fa00-0033"
neighbor_interface: "Ten-GigabitEthernet1/0/17"
neighbor: "SWITCH01"
- local_interface: "GE2/0/45"
chassis_id: "SEP0000000000A0"
neighbor_interface: "Port 1"
neighbor: "-"

0 comments on commit 6822ba1

Please sign in to comment.