From 7f2b4a8ba9b963399c0b94c6504d29168b79a1ab Mon Sep 17 00:00:00 2001 From: jack9603301 Date: Sat, 12 Dec 2020 00:36:57 +0800 Subject: interfaces: T3114: Improve the processing of enabling logic for `vlan_filter` to avoid redundant paths --- python/vyos/ifconfig/bridge.py | 4 ---- python/vyos/ifconfig/interface.py | 4 ---- 2 files changed, 8 deletions(-) (limited to 'python') diff --git a/python/vyos/ifconfig/bridge.py b/python/vyos/ifconfig/bridge.py index 959345f2f..3cbb23b8e 100644 --- a/python/vyos/ifconfig/bridge.py +++ b/python/vyos/ifconfig/bridge.py @@ -347,13 +347,9 @@ class BridgeIf(Interface): if 'allowed_vlan' in interface_config: vlan_filter = 1 - - if vlan_filter: if 'native_vlan' not in interface_config: cmd = f'bridge vlan del dev {interface} vid 1' self._cmd(cmd) - - if 'allowed_vlan' in interface_config: for vlan in interface_config['allowed_vlan']: cmd = f'bridge vlan add dev {interface} vid {vlan} master' self._cmd(cmd) diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py index e11c04209..699896cb2 100644 --- a/python/vyos/ifconfig/interface.py +++ b/python/vyos/ifconfig/interface.py @@ -918,13 +918,9 @@ class Interface(Control): if 'allowed_vlan' in bridge_config: vlan_filter = 1 - - if vlan_filter: if 'native_vlan' not in bridge_config: cmd = f'bridge vlan del dev {self.ifname} vid 1' self._cmd(cmd) - - if 'allowed_vlan' in bridge_config: for vlan in bridge_config['allowed_vlan']: cmd = f'bridge vlan add dev {self.ifname} vid {vlan} master' self._cmd(cmd) -- cgit v1.2.3