From 756c0ba444f937ebd464fbb332accfce02b6d3f6 Mon Sep 17 00:00:00 2001 From: kszd487 Date: Fri, 25 Aug 2023 02:42:28 +0300 Subject: [PATCH] fix lldp.py --- netbox_agent/lldp.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/netbox_agent/lldp.py b/netbox_agent/lldp.py index 7b991d5..21b645f 100644 --- a/netbox_agent/lldp.py +++ b/netbox_agent/lldp.py @@ -31,8 +31,9 @@ class LLDP(): 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, {}) -- 2.47.1