Skip to content

Commit

Permalink
fix lldp.py (#280)
Browse files Browse the repository at this point in the history
Co-authored-by: kszd487 <kszd487@ukc02dd0ylp3ywui.lan>
  • Loading branch information
Zagrebelsky and kszd487 authored Aug 28, 2023
1 parent 7ab7bbb commit ba4cdb2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions netbox_agent/lldp.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ def parse(self):
vlans[interface] = {}

for path_component in path_components:
current_dict[path_component] = current_dict.get(path_component, {})
current_dict = current_dict[path_component]
if not isinstance(current_dict.get(path_component), dict):
current_dict[path_component] = {}
current_dict = current_dict.get(path_component)
if 'vlan-id' in path:
vid = value
vlans[interface][value] = vlans[interface].get(vid, {})
Expand Down

0 comments on commit ba4cdb2

Please sign in to comment.