This commit is contained in:
illes 2023-09-03 01:53:14 -06:00 committed by GitHub
commit 2f6f757182
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 2 deletions

View file

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

View file

@ -247,7 +247,7 @@ class Network(object):
interface.untagged_vlan = None
# Finally if LLDP reports a vlan-id with the pvid attribute
elif lldp_vlan:
pvid_vlan = [key for (key, value) in lldp_vlan.items() if value['pvid']]
pvid_vlan = [key for (key, value) in lldp_vlan.items() if value.get('pvid')]
if len(pvid_vlan) > 0 and (
interface.mode is None or
interface.mode.value != self.dcim_choices['interface:mode']['Access'] or