From 7a4f30b843d8f11711abbb8f9bb263f945ff87ea Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 27 Jul 2020 15:37:44 -0700 Subject: [PATCH] fix for iface issue --- jc/parsers/route.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jc/parsers/route.py b/jc/parsers/route.py index ff8f21dc..b14558b5 100644 --- a/jc/parsers/route.py +++ b/jc/parsers/route.py @@ -84,7 +84,7 @@ import jc.parsers.universal class info(): - version = '1.3' + version = '1.4' description = 'route command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -188,7 +188,9 @@ def parse(data, raw=False, quiet=False): if jc.utils.has_data(data): # 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() raw_output = jc.parsers.universal.simple_table_parse(cleandata)