From 1fb6eb230ba6e9a3fb76faa0a217644030b5d013 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 2 Oct 2017 13:32:56 -0400 Subject: [PATCH] Change mind about peerid Stick to the identifiers mandated by LLDP, and only those to base the peerid (by-name can help otherwise). --- confluent_server/confluent/networking/lldp.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/confluent_server/confluent/networking/lldp.py b/confluent_server/confluent/networking/lldp.py index c10f1cd4..3da12769 100644 --- a/confluent_server/confluent/networking/lldp.py +++ b/confluent_server/confluent/networking/lldp.py @@ -161,8 +161,7 @@ def _extract_neighbor_data_b(args): for entry in lldpdata: entry = lldpdata[entry] entry['switch'] = switch - peerid = '{0}-{1}-{2}'.format( - entry.get('peername', ''), + peerid = '{0}-{1}'.format( entry.get('peerchassisid', '').replace(':', '-'), entry.get('peerport', '').replace(':', '-')) _neighbypeerid[peerid] = entry