1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-13 01:20:24 +02:00

fix for iface issue

This commit is contained in:
Kelly Brazil
2020-07-27 15:37:44 -07:00
parent b2c385dc4f
commit 7a4f30b843

View File

@ -84,7 +84,7 @@ import jc.parsers.universal
class info(): class info():
version = '1.3' version = '1.4'
description = 'route command parser' description = 'route command parser'
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
@ -188,7 +188,9 @@ def parse(data, raw=False, quiet=False):
if jc.utils.has_data(data): if jc.utils.has_data(data):
# fixup header row for ipv6 # fixup header row for ipv6
cleandata[0] = cleandata[0].replace(' Next Hop ', ' Next_Hop ').replace(' Flag ', ' Flags ').replace(' Met ', ' Metric ').replace(' If', ' Iface') if ' Next Hop ' in cleandata[0]:
cleandata[0] = cleandata[0].replace(' If', ' Iface')
cleandata[0] = cleandata[0].replace(' Next Hop ', ' Next_Hop ').replace(' Flag ', ' Flags ').replace(' Met ', ' Metric ')
cleandata[0] = cleandata[0].lower() cleandata[0] = cleandata[0].lower()
raw_output = jc.parsers.universal.simple_table_parse(cleandata) raw_output = jc.parsers.universal.simple_table_parse(cleandata)