handle multiple vlans in lldp #66
1 changed files with 5 additions and 4 deletions
|
@ -227,14 +227,15 @@ class Network():
|
||||||
# if lldp reports a vlan-id with pvid
|
# if lldp reports a vlan-id with pvid
|
||||||
elif lldp_vlan:
|
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['pvid']]
|
||||||
if len(pvid_vlan) and (
|
if len(pvid_vlan) > 0 and (
|
||||||
interface.mode is None or interface.mode.value != 100 or
|
interface.mode is None or
|
||||||
|
interface.mode.value != 100 or
|
||||||
interface.untagged_vlan is None or
|
interface.untagged_vlan is None or
|
||||||
interface.untagged_vlan.vid != pvid_vlan[0]):
|
interface.untagged_vlan.vid != int(pvid_vlan[0])):
|
||||||
logging.info('Resetting access VLAN on interface {interface}'.format(
|
logging.info('Resetting access VLAN on interface {interface}'.format(
|
||||||
interface=interface))
|
interface=interface))
|
||||||
update = True
|
update = True
|
||||||
nb_vlan = self.get_or_create_vlan(pvid_vlan)
|
nb_vlan = self.get_or_create_vlan(pvid_vlan[0])
|
||||||
interface.mode = 100
|
interface.mode = 100
|
||||||
interface.untagged_vlan = nb_vlan.id
|
interface.untagged_vlan = nb_vlan.id
|
||||||
return update, interface
|
return update, interface
|
||||||
|
|
Loading…
Reference in a new issue