fix lldp.py (#280)

Co-authored-by: kszd487 <kszd487@ukc02dd0ylp3ywui.lan>
This commit is contained in:
Oleg Zagrebelsky 2023-08-28 19:54:53 +03:00 committed by GitHub
parent 7ab7bbb9e1
commit ba4cdb217b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,8 +31,9 @@ class LLDP():
vlans[interface] = {} vlans[interface] = {}
for path_component in path_components: for path_component in path_components:
current_dict[path_component] = current_dict.get(path_component, {}) if not isinstance(current_dict.get(path_component), dict):
current_dict = current_dict[path_component] current_dict[path_component] = {}
current_dict = current_dict.get(path_component)
if 'vlan-id' in path: if 'vlan-id' in path:
vid = value vid = value
vlans[interface][value] = vlans[interface].get(vid, {}) vlans[interface][value] = vlans[interface].get(vid, {})