Skip to content

Commit 75dc1de

Browse files
authored
Merge pull request #926 from CiscoTestAutomation/release_25.1
Releasing v25.1
2 parents aaf4022 + b4b31e2 commit 75dc1de

File tree

822 files changed

+40018
-102632
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

822 files changed

+40018
-102632
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ TRUSTED_HOST = pyats-pypi.cisco.com
4545

4646
# Development pkg requirements
4747
RELATED_PKGS = genie.libs.parser
48-
DEPENDENCIES = xmltodict requests "netaddr<1.0.0"
48+
DEPENDENCIES = xmltodict requests netaddr
4949

5050
ifeq ($(MAKECMDGOALS), devnet)
5151
BUILD_CMD += --devnet
@@ -237,7 +237,7 @@ json:
237237
@echo "--------------------------------------------------------------------"
238238
@echo "Generating Parser json file"
239239
@echo ""
240-
@$(PYTHON) -W ignore::SyntaxWarning -c "from genie.json.make_json import make_genieparser; make_genieparser()"
240+
@$(PYTHON) -c "from genie.json.make_json import make_genieparser; make_genieparser()"
241241
@echo ""
242242
@echo "Done."
243243
@echo ""

changelog/2025/january.rst

+308
Large diffs are not rendered by default.

sdk_generator/outputs/github_parser.json

-96,402
This file was deleted.

src/genie/libs/parser/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
'''
99

1010
# metadata
11-
__version__ = '24.11'
11+
__version__ = '25.1'
1212
__author__ = 'Cisco Systems Inc.'
1313
1414
__copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.'

src/genie/libs/parser/asa/show_arp.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ def cli(self, output=None):
5858
# outside 10.10.1.1 aa11.bbff.ee55 alias
5959
# outside 10.10.1.1/1 aa11.bbff.ee55 -
6060
p1 = re.compile(r'^(?P<name>\S+) +(?P<ip>\d+.\d+.\d+.\d+)'
61-
'(\/(?P<prefix_length>[0-9]+))? +(?P<link_layer_address>\S+.\S+.\S+) '
62-
'+(?P<age>\S+)$')
61+
r'(\/(?P<prefix_length>[0-9]+))? +(?P<link_layer_address>\S+.\S+.\S+) '
62+
r'+(?P<age>\S+)$')
6363

6464
for line in out.splitlines():
6565
line = line.strip()

src/genie/libs/parser/asa/show_context.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def cli(self, output=None):
5353
# *admin default Vlan1000,Vlan1001, Routed disk0:/pod-context/admin.cfg
5454
p1 = re.compile(
5555
r'^(?P<context_name>\S+)\s+(?P<class>\S+)\s+(?P<interface>\S+)\s+'
56-
'(?P<mode>(?!Contexts:)\S+)\s+(?P<url>\S+)$')
56+
r'(?P<mode>(?!Contexts:)\S+)\s+(?P<url>\S+)$')
5757

5858
# Vlan1030,Vlan1031,
5959
# Vlan1082,Vlan1083...
@@ -174,8 +174,8 @@ def cli(self, output=None):
174174
# Vlan993, Vlan994, Vlan995, Vlan996, Vlan997, Vlan998, Vlan999
175175
p5 = re.compile(
176176
r'^(?P<interfaces>(\S+,)?\s*(\S+,)?\s*(\S+,)?\s*(\S+,)?\s*(\S+,)?\s*(\S+,)'
177-
'?\s*(\S+,)?\s*(\S+,)?\s*(\S+,)?\s*(\S+,)?\s*(\S+,)?\s*(\S+,)?\s*(\S+)'
178-
'?\s*)$')
177+
r'?\s*(\S+,)?\s*(\S+,)?\s*(\S+,)?\s*(\S+,)?\s*(\S+,)?\s*(\S+,)?\s*(\S+)'
178+
r'?\s*)$')
179179

180180
# Class: default, Flags: 0x00000111, ID: 1
181181
p6 = re.compile(

src/genie/libs/parser/asa/show_failover.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ def cli(self, output=None):
141141
# Failover LAN Interface: folink GigabitEthernet0/1 (up)
142142
p3 = re.compile(
143143
r'^Failover +LAN +Interface:\s(?P<name>[A-Za-z0-9\-\_]+)\s+'
144-
'(?P<interface>(Lo\S*|Fa\S*|Gi\S*|Ten\S*|\S*(SL|VL)\S*|Se\S*|VoIP\S*|Configured))'
145-
'( +\((?P<status>[A-Za-z0-0_\-\s]+)\))?$'
144+
r'(?P<interface>(Lo\S*|Fa\S*|Gi\S*|Ten\S*|\S*(SL|VL)\S*|Se\S*|VoIP\S*|Configured))'
145+
r'( +\((?P<status>[A-Za-z0-0_\-\s]+)\))?$'
146146
)
147147

148148
# Reconnect timeout 0:00:00
@@ -152,14 +152,14 @@ def cli(self, output=None):
152152
# Unit Poll frequency 300 milliseconds, holdtime 999 milliseconds
153153
p5 = re.compile(
154154
r'^Unit +Poll +frequency\s+(?P<poll>\d+)\s+(?P<poll_unit>seconds|milliseconds),'
155-
' +holdtime\s+(?P<holdtime>\d+)\s+(?P<holdtime_unit>seconds|milliseconds)$'
155+
r' +holdtime\s+(?P<holdtime>\d+)\s+(?P<holdtime_unit>seconds|milliseconds)$'
156156
)
157157

158158
# Interface Poll frequency 800 milliseconds, holdtime 5 seconds
159159
# Interface Poll frequency 5 seconds, holdtime 25 seconds
160160
p6 = re.compile(
161161
r'^Interface +Poll +frequency\s+(?P<poll>\d+)\s+(?P<poll_unit>seconds|milliseconds),'
162-
' +holdtime\s+(?P<holdtime>\d+)\s+(?P<holdtime_unit>seconds|milliseconds)$'
162+
r' +holdtime\s+(?P<holdtime>\d+)\s+(?P<holdtime_unit>seconds|milliseconds)$'
163163
)
164164

165165
# Interface Policy 1
@@ -173,13 +173,13 @@ def cli(self, output=None):
173173
# Version: Ours 9.14(1), Mate 9.14(1)
174174
p9 = re.compile(
175175
r'^Version: +Ours\s+(?P<ours>[A-Za-z0-9\.\(\)]+),'
176-
' +Mate\s+(?P<mate>[A-Za-z0-9\.\(\)]+)$'
176+
r' +Mate\s+(?P<mate>[A-Za-z0-9\.\(\)]+)$'
177177
)
178178

179179
# Serial Number: Ours 9AW2PSRETDT, Mate 9ASGGBEE416
180180
p10 = re.compile(
181181
r'^Serial +Number: +Ours\s+(?P<ours>[A-Za-z0-9]+),'
182-
' +Mate\s+(?P<mate>[A-Za-z0-9]+)$'
182+
r' +Mate\s+(?P<mate>[A-Za-z0-9]+)$'
183183
)
184184

185185
# Last Failover at: 20:37:30 UTC Apr 11 2021
@@ -200,16 +200,16 @@ def cli(self, output=None):
200200
# Interface outside (0.0.0.0/fe80::ecd:e9ff:fe5c:5301): Normal (Not-Monitored)
201201
p14 = re.compile(
202202
r'^Interface\s+(?P<interface>\w+)\s+\((?P<ipv4>[0-9\.]+)'
203-
'(\/(?P<ipv6>[A-Za-z0-9:]+))?\):\s+(?P<state>\w+)\s+'
204-
'\((?P<monitored_state>[A-Za-z0-9\-_]+)\)$'
203+
r'(\/(?P<ipv6>[A-Za-z0-9:]+))?\):\s+(?P<state>\w+)\s+'
204+
r'\((?P<monitored_state>[A-Za-z0-9\-_]+)\)$'
205205
)
206206

207207
# slot 0: ASAv hw/sw rev (/9.14(1)) status (Up Sys)
208208
# slot 1: IPS5515 hw/sw rev (N/A/7.1(4)E4) status (Up/Up)
209209
# slot 0: ASA5515 hw/sw rev (1.0/9.2(2)4) status (Up Sys)
210210
p15 = re.compile(
211211
r'^slot\s+(?P<slot>\d+):\s+(?P<model>[A-Za-z0-9\-_]+) +hw\/sw +rev\s+'
212-
'\((?P<version>\S+)\) +status\s+\((?P<status>[A-Za-z0-9_\-\s\/]+)\)$'
212+
r'\((?P<version>\S+)\) +status\s+\((?P<status>[A-Za-z0-9_\-\s\/]+)\)$'
213213
)
214214

215215
# Recv Q: 0 0 0
@@ -223,8 +223,8 @@ def cli(self, output=None):
223223
p17_1 = re.compile(r'^Stateful +Failover +Logical +Update +Statistics$')
224224
p17_2 = re.compile(
225225
r'^Link\s+:\s+(?P<name>[A-Za-z0-9]+)\s+'
226-
'(?P<interface>(Lo\S*|Fa\S*|Gi\S*|Ten\S*|\S*(SL|VL)\S*|Se\S*|VoIP\S*|Configured))'
227-
'( +\((?P<status>[A-Za-z0-0_\-\s]+)\))?$'
226+
r'(?P<interface>(Lo\S*|Fa\S*|Gi\S*|Ten\S*|\S*(SL|VL)\S*|Se\S*|VoIP\S*|Configured))'
227+
r'( +\((?P<status>[A-Za-z0-0_\-\s]+)\))?$'
228228
)
229229

230230
parsed_dict = {}

src/genie/libs/parser/asa/show_interface.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,19 @@ def cli(self, output=None):
6666
# Interface GigabitEthernet0/5 "", is administratively down, line protocol is up
6767
# Interface "nlp_int_tap", is up, line protocol is up
6868
p1 = re.compile(r'^Interface +((?P<interface>\S+) +)?"(?P<name>\S*)", +is +'
69-
'(?P<link_status>[\w\s]+), +line +protocol +is +(?P<line_protocol>\w+)$')
69+
r'(?P<link_status>[\w\s]+), +line +protocol +is +(?P<line_protocol>\w+)$')
7070

7171
# MAC address aa11.bbff.ee55, MTU 1500
7272
p2 = re.compile(r'^MAC address +(?P<mac_address>[\w\.]+), +MTU +(?P<mtu>\d+)$')
7373

7474
# IP address 10.10.10.1, subnet mask 255.255.255.0
7575
p3 = re.compile(r'^IP +address +(?P<ip>[a-z0-9\.]+)'
76-
'(\/(?P<prefix_length>[0-9]+))?, +subnet +mask '
77-
'+(?P<subnet>[\w\.]+)$')
76+
r'(\/(?P<prefix_length>[0-9]+))?, +subnet +mask '
77+
r'+(?P<subnet>[\w\.]+)$')
7878

7979
# Available but not configured via nameif
8080
p4 = re.compile(r'^(?P<interface_state>Available) +but +'
81-
'(?P<config_status>not +configured) +via +(?P<config_issue>\S*)$')
81+
r'(?P<config_status>not +configured) +via +(?P<config_issue>\S*)$')
8282

8383
for line in output.splitlines():
8484
line = line.strip()
@@ -328,27 +328,27 @@ def cli(self, output=None):
328328

329329
# Interface Vlan300 "admin-out", is up, line protocol is up
330330
p1 = re.compile(r'^Interface +(?P<interface>\S+) +"(?P<name>\S*)", +is +'
331-
'(?P<link_status>[\w\s]+), +line +protocol +is +(?P<line_protocol>\w+)$')
331+
r'(?P<link_status>[\w\s]+), +line +protocol +is +(?P<line_protocol>\w+)$')
332332

333333
# MAC address aa11.bbff.ee55, MTU 1500
334334
p2 = re.compile(r'^MAC address +(?P<mac_address>[\w\.]+), +MTU +(?P<mtu>\d+)$')
335335

336336
# IP address 10.10.10.1, subnet mask 255.255.255.0
337337
p3 = re.compile(r'^IP +address +(?P<ip>[a-z0-9\.]+)'
338-
'(\/(?P<prefix_length>[0-9]+))?, +subnet +mask '
339-
'+(?P<subnet>[\w\.]+)$')
338+
r'(\/(?P<prefix_length>[0-9]+))?, +subnet +mask '
339+
r'+(?P<subnet>[\w\.]+)$')
340340

341341
# Available but not configured via nameif
342342
p4 = re.compile(r'^(?P<interface_state>Available) +but +'
343-
'(?P<config_status>not +configured) +via +(?P<config_issue>\S*)$')
343+
r'(?P<config_status>not +configured) +via +(?P<config_issue>\S*)$')
344344

345345
# 889007666 packets input, 785740327549 bytes
346346
p5 = re.compile(r'^(?P<packets_input>\d+) +packets +input, '
347-
'+(?P<bytes_input>[\d]+) +bytes$')
347+
r'+(?P<bytes_input>[\d]+) +bytes$')
348348

349349
# 621453837 packets output, 428046938178 bytes
350350
p6 = re.compile(r'^(?P<packets_output>\d+) +packets +output, '
351-
'+(?P<bytes_output>[\d]+) +bytes$')
351+
r'+(?P<bytes_output>[\d]+) +bytes$')
352352

353353
# 2988535 packets dropped
354354
p7 = re.compile(r'^(?P<packets_dropped>\d+) +packets +dropped$')
@@ -359,7 +359,7 @@ def cli(self, output=None):
359359
# Interface config status is active
360360
# Interface config status is not active
361361
p9 = re.compile(r'^Interface +config +status +is '
362-
'+(?P<interface_config_status>[\S\s]+)$')
362+
r'+(?P<interface_config_status>[\S\s]+)$')
363363

364364
# Interface state is active
365365
# Interface state is not active
@@ -368,12 +368,12 @@ def cli(self, output=None):
368368
# Interface vlan config status is active
369369
# Interface vlan config status is not active
370370
p11 = re.compile(r'^Interface +vlan +config +status +is '
371-
'+(?P<interface_vlan_config_status>[\S\s]+)$')
371+
r'+(?P<interface_vlan_config_status>[\S\s]+)$')
372372

373373
# Interface vlan state is UP
374374
# Interface vlan state is DOWN (down in system space)
375375
p12 = re.compile(r'^Interface +vlan +state +is +'
376-
'(?P<interface_vlan_state>\w+)+([\S\s]+)?$')
376+
r'(?P<interface_vlan_state>\w+)+([\S\s]+)?$')
377377

378378
for line in out.splitlines():
379379
line = line.strip()

src/genie/libs/parser/asa/show_route.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from genie.metaparser import MetaParser
1010
from genie.metaparser.util.schemaengine import Any, Optional, Or
11-
from netaddr import IPAddress
11+
from netaddr import IPAddress, INET_ATON
1212

1313

1414
# =============================================
@@ -187,15 +187,15 @@ def cli(self, output=None):
187187
# D 10.0.0.0 255.255.255.0 [90/30720] via 192.168.1.1, 0:19:52, inside
188188
p8 = re.compile(
189189
r'^(?P<code>\S+)\s(?P<network>\S+)\s(?P<subnet>\S+)\s\[(?P<route_preference>[\d\/]+)\]'
190-
'\svia\s+(?P<next_hop>\S+),\s(?P<date>\S+),\s+(?P<context_name>\S+)')
190+
r'\svia\s+(?P<next_hop>\S+),\s(?P<date>\S+),\s+(?P<context_name>\S+)')
191191

192192
# B 10.122.3.0 255.255.255.0 [20/0]
193193
p9 = re.compile(r'(?P<code>\S+)\s(?P<network>\S+)\s(?P<subnet>\S+)\s\[(?P<route_preference>[\d\/]+)\]')
194194

195195
# [170/345856] via 10.9.193.99, 2w1d, esavpn [170/345856] via 10.9.193.98, 2w1d, esavpn
196196
p10 = re.compile(
197197
r'\[(?P<route_preference>[\d\/]+)\]\svia\s+(?P<next_hop>\S+),\s(?P<date>\S+),'
198-
'\s(?P<context_name>\S+)')
198+
r'\s(?P<context_name>\S+)')
199199

200200
# D EX 10.121.67.0 255.255.255.0
201201
p11 = re.compile(r'^(?:\S+)\s(?P<code>\S+)\s(?P<network>\S+)\s(?P<subnet>\S+)')
@@ -272,7 +272,7 @@ def cli(self, output=None):
272272
else:
273273
continue
274274

275-
prefix_length = str(IPAddress(groups['subnet']).netmask_bits())
275+
prefix_length = str(IPAddress(groups['subnet'], flags=INET_ATON).netmask_bits())
276276
combined_ip = groups['network'] + '/' + prefix_length
277277
dict_route = target_dict.setdefault(combined_ip, {})
278278

src/genie/libs/parser/asa/show_traffic.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,22 @@ def cli(self, output=None):
8181

8282
# 1 minute input rate 9452 pkts/sec, 661142 bytes/sec
8383
p5 = re.compile(r'^1 minute input rate\s+(?P<packets_input_1_minute>\d+)\s+pkts\/sec,\s+'
84-
'(?P<bytes_input_1_minute>\d+)\s+bytes\/sec$')
84+
r'(?P<bytes_input_1_minute>\d+)\s+bytes\/sec$')
8585

8686
# 1 minute output rate 206 pkts/sec, 41887 bytes/sec
8787
p6 = re.compile(r'^1 minute output rate\s+(?P<packets_output_1_minute>\d+)\s+pkts\/sec,\s+'
88-
'(?P<bytes_output_1_minute>\d+)\s+bytes\/sec$')
88+
r'(?P<bytes_output_1_minute>\d+)\s+bytes\/sec$')
8989

9090
# 1 minute drop rate, 0 pkts/sec
9191
p7 = re.compile(r'^1 minute drop rate,\s+(?P<packets_drop_rate_1_minute>\d+)\s+pkts\/sec$')
9292

9393
# 5 minute input rate 11309 pkts/sec, 790978 bytes/sec
9494
p8 = re.compile(r'^5 minute input rate\s+(?P<packets_input_5_minute>\d+)\s+pkts\/sec,\s+'
95-
'(?P<bytes_input_5_minute>\d+)\s+bytes\/sec$')
95+
r'(?P<bytes_input_5_minute>\d+)\s+bytes\/sec$')
9696

9797
# 5 minute output rate 0 pkts/sec, 0 bytes/sec
9898
p9 = re.compile(r'^5 minute output rate\s+(?P<packets_output_5_minute>\d+)\s+pkts\/sec,\s+'
99-
'(?P<bytes_output_5_minute>\d+)\s+bytes\/sec$')
99+
r'(?P<bytes_output_5_minute>\d+)\s+bytes\/sec$')
100100

101101
# 5 minute drop rate, 0 pkts/sec
102102
p10 = re.compile(r'^5 minute drop rate,\s+(?P<packets_drop_rate_5_minute>\d+)\s+pkts\/sec$')

src/genie/libs/parser/cheetah/show_interface.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,10 @@ def cli(self, ifnum, output=None):
399399
p1_4 = re.compile(r'^(?P<attributes>[\w\s]+)?\s+MTU:(?P<mtu>\d+)\s+Metric:(?P<metric>\d+)$')
400400

401401
# RX packets:26749820 errors:0 dropped:0 overruns:0 frame:0
402-
p1_5 = re.compile('^RX packets:(?P<packets>\d+) errors:(?P<error>\d+) dropped:(?P<drop>\d+) overruns:(?P<overrun>\d+) frame:(?P<frame>\d+)$')
402+
p1_5 = re.compile(r'^RX packets:(?P<packets>\d+) errors:(?P<error>\d+) dropped:(?P<drop>\d+) overruns:(?P<overrun>\d+) frame:(?P<frame>\d+)$')
403403

404404
# TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
405-
p1_6 = re.compile('^TX packets:(?P<packets>\d+) errors:(?P<error>\d+) dropped:(?P<drop>\d+) overruns:(?P<overrun>\d+) carrier:(?P<carrier>\d+)$')
405+
p1_6 = re.compile(r'^TX packets:(?P<packets>\d+) errors:(?P<error>\d+) dropped:(?P<drop>\d+) overruns:(?P<overrun>\d+) carrier:(?P<carrier>\d+)$')
406406

407407
# collisions:0 txqueuelen:1000
408408
p1_7 = re.compile(r'^collisions:(?P<collisions>\d+) txqueuelen:(?P<txqueuelen>\d+)$')

src/genie/libs/parser/ios/cat6k/show_platform.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -848,11 +848,11 @@ def cli(self, output=None):
848848

849849
# NAME: "HundredGigE1/0/48", DESCR: "QSFP 100GE SR"
850850
p1 = re.compile(r'^NAME: +\"(?P<name>.*)\",'
851-
' +DESCR: +\"(?P<descr>.*)\"$')
851+
r' +DESCR: +\"(?P<descr>.*)\"$')
852852

853853
# PID: QSFP-100G-SR4-S , VID: V03 , SN: AVF2243S10A
854854
p2 = re.compile(r'^PID: +(?P<pid>\S+)? *, +VID:(?: +(?P<vid>(\S+)))? *,'
855-
' +SN:(?: +(?P<sn>(\S+)))?$')
855+
r' +SN:(?: +(?P<sn>(\S+)))?$')
856856

857857
for line in out.splitlines():
858858
line = line.strip()
@@ -975,31 +975,31 @@ def cli(self, output=None):
975975
# 1 2 Catalyst 6000 supervisor 2 (Active) WS-X6K-S2U-MSFC2 SAD0628035C
976976
# 2 0 Supervisor-Other unknown unknown
977977
r1 = re.compile(r'(?P<mod>\d)\s+(?P<ports>\d+)\s+(?P<card_type>.+'
978-
'(S|s)upervisor.+)\s+(?P<model>\S+)\s+'
979-
'(?P<serial_number>\S+)')
978+
r'(S|s)upervisor.+)\s+(?P<model>\S+)\s+'
979+
r'(?P<serial_number>\S+)')
980980

981981
# 6 1 1 port 10-Gigabit Ethernet Module WS-X6502-10GE SAD062003CM
982982
# 3 16 Pure SFM-mode 16 port 1000mb GBIC WS-X6816-GBIC SAL061218K3
983983
r2 = re.compile(r'(?P<mod>\d)\s+(?P<ports>\d+)\s+(?P<card_type>.+\d+\s+'
984-
'port.+)\s{2,}(?P<model>\S+)\s+(?P<serial_number>\S+)')
984+
r'port.+)\s{2,}(?P<model>\S+)\s+(?P<serial_number>\S+)')
985985

986986
# 5 0 Switching Fabric Module-136 (Active) WS-X6500-SFM2 SAD061701YC
987-
r3 = re.compile('(?P<mod>\d)\s+(?P<ports>\d+)\s+(?P<card_type>.+)\s{2,}'
988-
'(?P<model>\S+)\s+(?P<serial_number>\S+)')
987+
r3 = re.compile(r'(?P<mod>\d)\s+(?P<ports>\d+)\s+(?P<card_type>.+)\s{2,}'
988+
r'(?P<model>\S+)\s+(?P<serial_number>\S+)')
989989

990990
# 1 0001.64ff.1958 to 0001.64ff.1959 3.9 6.1(3) 7.5(0.6)HUB9 Ok
991991
# 3 0005.74ff.1b9d to 0005.74ff.1bac 1.3 12.1(5r)E1 12.1(13)E3, Ok
992992
# 1 0001.64ff.1958 to 0001.64ff.1959 3.9 6.1(3) 7.5(0.6)HUB9 Ok
993993
r4 = re.compile(r'(?P<mod>\d+)\s+(?P<mac_from>\S+)\s+to\s+(?P<mac_to>\S+)'
994-
'\s+(?P<hw>\S+)\s+(?P<fw>\S+)\s+(?P<sw>[\d\.\(\)\w]+)\,'
995-
'*\s+(?P<status>(Ok|Unknown))')
994+
r'\s+(?P<hw>\S+)\s+(?P<fw>\S+)\s+(?P<sw>[\d\.\(\)\w]+)\,'
995+
r'*\s+(?P<status>(Ok|Unknown))')
996996

997997
# 1 Policy Feature Card 2 WS-F6K-PFC2 SAD062802AV 3.2 Ok
998998
# 1 Cat6k MSFC 2 daughterboard WS-F6K-MSFC2 SAD062803TX 2.5 Ok
999999
# 6 Distributed Forwarding Card WS-F6K-DFC SAL06261R0A 2.3 Ok
10001000
# 6 10GBASE-LR Serial 1310nm lo WS-G6488 SAD062201BN 1.1 Ok
10011001
r5 = re.compile(r'(?P<mod>\d+)\s+(?P<sub_mod>.+)\s+(?P<model>\S+)\s+'
1002-
'(?P<serial>\S+)\s+(?P<hw>\S+)\s+(?P<status>(Ok|Unknown))')
1002+
r'(?P<serial>\S+)\s+(?P<hw>\S+)\s+(?P<status>(Ok|Unknown))')
10031003

10041004
# 1 Pass
10051005
r6 = re.compile(r'(?P<mod>\d+) +(?P<online_diag_status>\S+)$')

src/genie/libs/parser/ios/show_bgp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class ShowBgpAllSummary(ShowBgpAllSummary_iosxe):
7878
class ShowBgpAllClusterIds(ShowBgpAllClusterIds_iosxe):
7979
"""
8080
Parser for show bgp all cluster-ids
81-
Executing 'show vrf detail | inc \(VRF' to collect vrf names.
81+
Note: this parser executes 'show vrf detail | inc \\(VRF' to collect vrf names.
8282
"""
8383
pass
8484

src/genie/libs/parser/ios/show_key_chain.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def cli(self, output=None):
6161
# accept lifetime (10:10:10 UTC Jan 1 2002) - (06:01:00 UTC Jan 1 2010)
6262
p3 = re.compile(
6363
r'^accept\s+lifetime\s+\((?P<start>[A-Za-z0-9:\s\+\-_]+)\)\s+\-\s+'
64-
'\((?P<end>[A-Za-z0-9:\s\+\-_]+)\)'
64+
r'\((?P<end>[A-Za-z0-9:\s\+\-_]+)\)'
6565
r'(\s+\[(?P<is_valid>[A-Za-z0-9\s\-_]+)\])?$'
6666
)
6767

@@ -70,7 +70,7 @@ def cli(self, output=None):
7070
# send lifetime (always valid) - (always valid) [valid now]
7171
p4 = re.compile(
7272
r'^send\s+lifetime\s+\((?P<start>[A-Za-z0-9:\s\+\-_]+)\)\s+\-\s+'
73-
'\((?P<end>[A-Za-z0-9:\s\+\-_]+)\)'
73+
r'\((?P<end>[A-Za-z0-9:\s\+\-_]+)\)'
7474
r'(\s+\[(?P<is_valid>[A-Za-z0-9\s\-_]+)\])?$'
7575
)
7676

src/genie/libs/parser/ios/show_ntp.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,18 @@ def cli(self, output=None):
9797
# ~10.4.1.1 .INIT. 16 - 1024 0 0.000 0.000 15937.
9898
# +~10.16.2.2 127.127.1.1 8 137 64 1 15.917 556.786 7938.0
9999
p1 = re.compile(r'^(?P<mode_code>[x\*\#\+\- ])?(?P<configured>[\~])? *(?P<remote>[\w\.\:]+) +'
100-
'(?P<refid>[\w\.]+) +(?P<stratum>\d+) +'
101-
'(?P<receive_time>[\d\-]+) +(?P<poll>\d+) +'
102-
'(?P<reach>\d+) +(?P<delay>[\d\.]+) +'
103-
'(?P<offset>[\d\.\-]+) +(?P<disp>[\d\.\-]+)$')
100+
r'(?P<refid>[\w\.]+) +(?P<stratum>\d+) +'
101+
r'(?P<receive_time>[\d\-]+) +(?P<poll>\d+) +'
102+
r'(?P<reach>\d+) +(?P<delay>[\d\.]+) +'
103+
r'(?P<offset>[\d\.\-]+) +(?P<disp>[\d\.\-]+)$')
104104

105105
# * sys.peer, # selected, + candidate, - outlyer, x falseticker, ~ configured
106106
p2 = re.compile(r'^\* sys.peer, +\# selected, +\+ candidate, +- outlyer, '
107-
'+x falseticker, +~ configured$')
107+
r'+x falseticker, +~ configured$')
108108

109109
# * master (synced), # master (unsynced), + selected, - candidate, ~ configured
110110
p3 = re.compile(r'^\* master +\(synced\), +\# master \(unsynced\), +\+ '
111-
'selected, +\- candidate, +~ configured$')
111+
r'selected, +\- candidate, +~ configured$')
112112

113113
for line in out.splitlines():
114114
line = line.strip()

0 commit comments

Comments
 (0)