Fix KeyError: 'pvid' in lldp.py #223

Open
illes wants to merge 2 commits from illes/patch-1 into main
Showing only changes of commit a59fb446f3 - Show all commits

View file

@ -37,7 +37,7 @@ class LLDP():
vid = value vid = value
vlans[interface][value] = vlans[interface].get(vid, {}) vlans[interface][value] = vlans[interface].get(vid, {})
elif path.endswith('vlan'): elif path.endswith('vlan'):
vid = value.replace('vlan-', '') vid = value.replace('vlan-', '').replace('VLAN', '')
vlans[interface][vid] = vlans[interface].get(vid, {}) vlans[interface][vid] = vlans[interface].get(vid, {})
elif 'pvid' in path: elif 'pvid' in path:
vlans[interface][vid]['pvid'] = True vlans[interface][vid]['pvid'] = True