From df72b1602285127aa3bf4f99700959cae93bab71 Mon Sep 17 00:00:00 2001 From: Dave Marquardt Date: Fri, 6 Jan 2023 10:00:58 -0600 Subject: [PATCH] Start to fix AIX ARP support --- jc/parsers/arp.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/jc/parsers/arp.py b/jc/parsers/arp.py index 130fa7a1..2036f39e 100644 --- a/jc/parsers/arp.py +++ b/jc/parsers/arp.py @@ -222,14 +222,24 @@ def parse( else: for line in cleandata: splitline = line.split() - if '' not in splitline: + + # Ignore AIX bucket information + if 'bucket:' in splitline[0]: + continue + elif 'There' in splitline[0] and 'are' in splitline[1]: + continue + + elif '' not in splitline: output_line = { 'name': splitline[0], 'address': splitline[1].lstrip('(').rstrip(')'), 'hwtype': splitline[4].lstrip('[').rstrip(']'), 'hwaddress': splitline[3], - 'iface': splitline[6], } + # AIX tells what bucket the entry is in, and no interface + # information + if 'in' not in splitline[6]: + output_line['iface'] = splitline[6] else: output_line = {