]> git.proxmox.com Git - mirror_ifupdown2.git/commitdiff
addons: bridge: bridge_vlan_aware_list is now a set()
authorJulien Fortin <jfortin@nvidia.com>
Wed, 14 Apr 2021 22:33:31 +0000 (00:33 +0200)
committerJulien Fortin <jfortin@nvidia.com>
Thu, 1 Jul 2021 15:45:59 +0000 (17:45 +0200)
in the case of ifreload bridge.py:get_dependent is entered twice,
once for the old ifaceobjs and once for the new ones. Thus adding
bridges twice to the list. Having a set will prevent this issue.

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
ifupdown2/addons/bridge.py
ifupdown2/lib/addon.py

index 426a5adeb6ab4466f2e1a032a0cb49fbecce7048..635f2638332907248a07d1de4d4cea416cca6902 100644 (file)
@@ -1029,7 +1029,7 @@ class bridge(Bridge, moduleBase):
             ifaceobj.link_privflags |= ifaceLinkPrivFlags.BRIDGE_VLAN_AWARE
 
             # store the name of all bridge vlan aware in a global list
-            self.bridge_vlan_aware_list.append(ifaceobj.name)
+            self.bridge_vlan_aware_list.add(ifaceobj.name)
 
         ifaceobj.role |= ifaceRole.MASTER
         ifaceobj.dependency_type = ifaceDependencyType.MASTER_SLAVE
index b24c7eeee96c7f7aaf57cbcc54ae42b2a3a33318..1c86bbe9a805b472e4fe2b6fae4981f3adde7bba 100644 (file)
@@ -93,7 +93,7 @@ class Addon(Netlink, Cache):
 
 class Bridge(Addon):
 
-    bridge_vlan_aware_list = []
+    bridge_vlan_aware_list = set()
 
     def __init__(self):
         super(Bridge, self).__init__()