mirror of
https://github.com/xcat2/confluent.git
synced 2025-01-12 10:49:17 +00:00
Ignore broken lldp results
Some switches may have broken incomplete records, skip such records to focus on viable complete records.
This commit is contained in:
parent
f881f955d4
commit
1b88e44c59
@ -239,22 +239,30 @@ def _extract_neighbor_data_b(args):
|
||||
idxtoifname[idx] = _lldpdesc_to_ifname(sid, idx, str(oidindex[1]))
|
||||
for remotedesc in conn.walk('1.0.8802.1.1.2.1.4.1.1.10'):
|
||||
iname = idxtoifname.get(remotedesc[0][-2],
|
||||
idxtoportid[remotedesc[0][-2]])
|
||||
idxtoportid.get(remotedesc[0][-2], None))
|
||||
if iname is None:
|
||||
continue
|
||||
_init_lldp(lldpdata, iname, remotedesc[0][-2], idxtoportid, switch)
|
||||
_extract_extended_desc(lldpdata[iname], remotedesc[1], user)
|
||||
for remotename in conn.walk('1.0.8802.1.1.2.1.4.1.1.9'):
|
||||
iname = idxtoifname.get(remotename[0][-2],
|
||||
idxtoportid[remotename[0][-2]])
|
||||
idxtoportid.get(remotename[0][-2], None))
|
||||
if iname is None:
|
||||
continue
|
||||
_init_lldp(lldpdata, iname, remotename[0][-2], idxtoportid, switch)
|
||||
lldpdata[iname]['peername'] = str(remotename[1])
|
||||
for remotename in conn.walk('1.0.8802.1.1.2.1.4.1.1.7'):
|
||||
iname = idxtoifname.get(remotename[0][-2],
|
||||
idxtoportid[remotename[0][-2]])
|
||||
idxtoportid.get(remotename[0][-2], None))
|
||||
if iname is None:
|
||||
continue
|
||||
_init_lldp(lldpdata, iname, remotename[0][-2], idxtoportid, switch)
|
||||
lldpdata[iname]['peerportid'] = sanitize(remotename[1])
|
||||
for remoteid in conn.walk('1.0.8802.1.1.2.1.4.1.1.5'):
|
||||
iname = idxtoifname.get(remoteid[0][-2],
|
||||
idxtoportid[remoteid[0][-2]])
|
||||
idxtoportid.get(remoteid[0][-2], None))
|
||||
if iname is None:
|
||||
continue
|
||||
_init_lldp(lldpdata, iname, remoteid[0][-2], idxtoportid, switch)
|
||||
lldpdata[iname]['peerchassisid'] = sanitize(remoteid[1])
|
||||
for entry in lldpdata:
|
||||
|
Loading…
x
Reference in New Issue
Block a user