Skip to content

Commit 5ab8e4b

Browse files
authored
Fix arista_eos sh vrf since RD column was removed (#2185)
* Regenerate structured data in alphabetical order * Match dashes separator * Modify section separating comments * Fix arista_eos sh vrf since RD column was removed * Account for VRF named like an interface - Augment test data to artificially make VRFs that have capital/number - Don't match a VRF name if it begins with a capital letter and ends with a number - Revert interface regex change
1 parent 55f0471 commit 5ab8e4b

File tree

6 files changed

+173
-28
lines changed

6 files changed

+173
-28
lines changed

ntc_templates/templates/arista_eos_show_vrf.textfsm

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Value List INTERFACES ([\w\./-]+)
44

55
Start
66
^\s+V[rR][fF]\s+RD\s+Protocols\s+State\s+Interfaces -> VRF
7+
^\s+V[rR][fF]\s+Protocols\s+State\s+Interfaces -> VRF_NO_RD
78
^Maximum
89
^\s*$$
910
^. -> Error
@@ -37,7 +38,7 @@ VRF
3738
# three interfaces displayed per line
3839
^\s+\S+\s+\S+(\s\S+)*\s+\S+\s+\S+:\S+(\s\S+)*,?\s+(?:\S+,\s){2}${INTERFACES}, -> Continue
3940
#
40-
############## Lines that contains state ##################
41+
############## Lines that contain state ##################
4142
#
4243
# match state only line
4344
^\s+(\S+:\S+(?:\s\S+)*)\s*$$
@@ -92,4 +93,47 @@ VRF
9293
################## For vrfs without interfaces ###################
9394
#
9495
# match vrf line with no interfaces
95-
^\s+${VRF}\s+${RD}\s+\S+\s+\S+:\S+(\s\S+)*,?\s+$$
96+
^\s+${VRF}\s+${RD}\s+\S+\s+\S+:\S+(\s\S+)*,?\s+$$
97+
#
98+
################## Unmatched ###################
99+
^---+
100+
101+
VRF_NO_RD
102+
^\s+\S+\s+\S+\s+(no\s)?routing.*$$ -> Continue.Record
103+
#
104+
# no interfaces
105+
^\s+${VRF}\s+\S+\s+(no\s)?routing\s+$$ -> Record
106+
#
107+
# first line, first interface
108+
^\s+${VRF}\s+\S+\s+\S+(\s\S+)?\s+${INTERFACES},?(\s\S+,?)*\s*$$ -> Continue
109+
# first line, second of multiple interfaces
110+
^\s+\S+\s+\S+\s+\S+(\s\S+)?\s+(?:\S+,\s){1}${INTERFACES},? -> Continue
111+
# first line, third of multiple interfaces
112+
^\s+\S+\s+\S+\s+\S+(\s\S+)?\s+(?:\S+,\s){2}${INTERFACES},? -> Continue
113+
# first line, fourth of multiple interfaces
114+
^\s+\S+\s+\S+\s+\S+(\s\S+)?\s+(?:\S+,\s){3}${INTERFACES},? -> Continue
115+
# first line, fifth of multiple interfaces
116+
^\s+\S+\s+\S+\s+\S+(\s\S+)?\s+(?:\S+,\s){4}${INTERFACES},? -> Continue
117+
# first line, sixth of multiple interfaces
118+
^\s+\S+\s+\S+\s+\S+(\s\S+)?\s+(?:\S+,\s){5}${INTERFACES},? -> Continue
119+
# first line, seventh of multiple interfaces
120+
^\s+\S+\s+\S+\s+\S+(\s\S+)?\s+(?:\S+,\s){6}${INTERFACES},? -> Continue
121+
#
122+
# line begins with whitespace, first interface
123+
^\s+${INTERFACES}, -> Continue
124+
^\s+${INTERFACES}$$ -> Continue
125+
# line begins with whitespace, second interface
126+
^\s+(?:\S+,\s){1}${INTERFACES},? -> Continue
127+
# line begins with whitespace, third interface
128+
^\s+(?:\S+,\s){2}${INTERFACES},? -> Continue
129+
# line begins with whitespace, fourth interface
130+
^\s+(?:\S+,\s){3}${INTERFACES},? -> Continue
131+
# line begins with whitespace, fifth interface
132+
^\s+(?:\S+,\s){4}${INTERFACES},? -> Continue
133+
# line begins with whitespace, sixth interface
134+
^\s+(?:\S+,\s){5}${INTERFACES},? -> Continue
135+
# line begins with whitespace, seventh interface
136+
^\s+(?:\S+,\s){6}${INTERFACES},? -> Continue
137+
#
138+
# Unmatched
139+
^---+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Maximum number of VRFs allowed: 1023
2+
VRF Protocols State Interfaces
3+
--------------- --------------- ---------------- ---------------------------------------
4+
default IPv4 routing Vl2000, Vl4094
5+
default IPv6 no routing
6+
guest-wan IPv4 routing Et4.930, Lo23, Vl23, Vl53, Vl93, Vl466
7+
guest-wan IPv6 no routing
8+
p-wan IPv4 routing Et3, Lo29, Vl2, Vl5, Vl22, Vl29, Vl55,
9+
Vl99, Vl463
10+
p-wan IPv6 no routing
11+
sdwan IPv4 routing Et2
12+
sdwan IPv6 no routing
13+
Sip-ext3 IPv4 routing Et19, Vl204, Vl206, Vl207, Vl213
14+
Sip-ext3 IPv6 no routing
15+
Sip-wan6 IPv4 routing Vl58, Vl89, Vl205, Vl208, Vl209, Vl210,
16+
Vl211, Vl212, Vl468
17+
Sip-wan6 IPv6 no routing
18+
trade-wan IPv4 routing Et4.970, Lo26, Vl26, Vl57, Vl96, Vl465
19+
trade-wan IPv6 no routing
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
parsed_sample:
3+
- interfaces:
4+
- "Vl2000"
5+
- "Vl4094"
6+
rd: ""
7+
vrf: "default"
8+
- interfaces: []
9+
rd: ""
10+
vrf: "default"
11+
- interfaces:
12+
- "Et4.930"
13+
- "Lo23"
14+
- "Vl23"
15+
- "Vl53"
16+
- "Vl93"
17+
- "Vl466"
18+
rd: ""
19+
vrf: "guest-wan"
20+
- interfaces: []
21+
rd: ""
22+
vrf: "guest-wan"
23+
- interfaces:
24+
- "Et3"
25+
- "Lo29"
26+
- "Vl2"
27+
- "Vl5"
28+
- "Vl22"
29+
- "Vl29"
30+
- "Vl55"
31+
- "Vl99"
32+
- "Vl463"
33+
rd: ""
34+
vrf: "p-wan"
35+
- interfaces: []
36+
rd: ""
37+
vrf: "p-wan"
38+
- interfaces:
39+
- "Et2"
40+
rd: ""
41+
vrf: "sdwan"
42+
- interfaces: []
43+
rd: ""
44+
vrf: "sdwan"
45+
- interfaces:
46+
- "Et19"
47+
- "Vl204"
48+
- "Vl206"
49+
- "Vl207"
50+
- "Vl213"
51+
rd: ""
52+
vrf: "Sip-ext3"
53+
- interfaces: []
54+
rd: ""
55+
vrf: "Sip-ext3"
56+
- interfaces:
57+
- "Vl58"
58+
- "Vl89"
59+
- "Vl205"
60+
- "Vl208"
61+
- "Vl209"
62+
- "Vl210"
63+
- "Vl211"
64+
- "Vl212"
65+
- "Vl468"
66+
rd: ""
67+
vrf: "Sip-wan6"
68+
- interfaces: []
69+
rd: ""
70+
vrf: "Sip-wan6"
71+
- interfaces:
72+
- "Et4.970"
73+
- "Lo26"
74+
- "Vl26"
75+
- "Vl57"
76+
- "Vl96"
77+
- "Vl465"
78+
rd: ""
79+
vrf: "trade-wan"
80+
- interfaces: []
81+
rd: ""
82+
vrf: "trade-wan"
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
parsed_sample:
3-
- vrf: "blue"
4-
rd: "10.125.253.15:1"
5-
interfaces:
3+
- interfaces:
64
- "Vlan1006"
75
- "Vlan2230"
86
- "Vlan2231"
@@ -15,24 +13,26 @@ parsed_sample:
1513
- "Vlan2238"
1614
- "Vlan2240"
1715
- "Vlan2239"
18-
- vrf: "green"
19-
rd: "<not set>"
20-
interfaces:
16+
rd: "10.125.253.15:1"
17+
vrf: "blue"
18+
- interfaces:
2119
- "Vlan1015"
2220
- "Vlan1016"
2321
- "Vlan1017"
2422
- "Vlan1018"
2523
- "Vlan1019"
2624
- "Vlan1020"
2725
- "Vlan1021"
28-
- vrf: "yellow"
29-
rd: "10.125.253.15:4"
30-
interfaces:
26+
rd: "<not set>"
27+
vrf: "green"
28+
- interfaces:
3129
- "Vlan1009"
32-
- vrf: "red"
30+
rd: "10.125.253.15:4"
31+
vrf: "yellow"
32+
- interfaces: []
3333
rd: "10.125.253.15:6"
34-
interfaces: []
35-
- vrf: "black"
36-
rd: "999:999"
37-
interfaces:
34+
vrf: "red"
35+
- interfaces:
3836
- "Management1"
37+
rd: "999:999"
38+
vrf: "black"
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
parsed_sample:
3-
- vrf: "red"
4-
rd: "100:100"
5-
interfaces:
3+
- interfaces:
64
- "Ethernet3"
75
- "Ethernet4"
86
- "Ethernet5"
97
- "Ethernet6"
108
- "Ethernet7"
11-
- vrf: "blue"
12-
rd: "1:1"
13-
interfaces:
9+
rd: "100:100"
10+
vrf: "red"
11+
- interfaces:
1412
- "Management1"
13+
rd: "1:1"
14+
vrf: "blue"
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
22
parsed_sample:
3-
- vrf: "red"
4-
rd: "<not set>"
5-
interfaces:
3+
- interfaces:
64
- "Ethernet10"
75
- "Ethernet20/1"
86
- "Loopback0"
97
- "Vlan100"
108
- "Vlan200"
11-
- vrf: "blue"
12-
rd: "1:1"
13-
interfaces:
9+
rd: "<not set>"
10+
vrf: "red"
11+
- interfaces:
1412
- "Ethernet20/1.10"
1513
- "Loopback1"
1614
- "Port-Channel1.20"
15+
rd: "1:1"
16+
vrf: "blue"

0 commit comments

Comments
 (0)