Skip to content

Commit 993f4e9

Browse files
committed
IOSXE LLDP: One more parsing fixup
Signed-off-by: Dinesh Dutt <[email protected]>
1 parent ce1e591 commit 993f4e9

File tree

1 file changed

+10
-0
lines changed
  • suzieq/poller/worker/services

1 file changed

+10
-0
lines changed

suzieq/poller/worker/services/lldp.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,16 @@ def _clean_iosxe_data(self, processed_data, _):
207207
entry['peerHostname'])
208208
if not entry['ifname']:
209209
drop_indices.append(i)
210+
211+
# IOS can have the last 2 columns of its output as either
212+
# Gig 0/1/2 or N5K Gig 0/1/2 or N5K mgmt0. In this last
213+
# case we accidentally assume N5kmgmt0 as the peer interface
214+
# name. The following code tries to fix that.
215+
pif = entry.get('peerIfname', '')
216+
if pif:
217+
words = pif.split()
218+
if words[-1] == "mgmt0":
219+
entry['peerIfname'] = "mgmt0"
210220
for field in ['ifname', 'peerIfname']:
211221
entry[field] = expand_ios_ifname(entry[field])
212222
if ' ' in entry.get(field, ''):

0 commit comments

Comments
 (0)