summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-07-30 19:52:03 +0200
committerChristian Poessinger <christian@poessinger.com>2022-07-31 19:43:03 +0200
commit0bf98f8d75304b9554efd68e11ede9f72bed71d0 (patch)
treec75ca592345c2c26ff6c74fc94cd5bf35f972b74 /python/vyos
parenta782eb0711af53a0565589d67056c9706ec328fc (diff)
downloadvyos-1x-0bf98f8d75304b9554efd68e11ede9f72bed71d0.tar.gz
vyos-1x-0bf98f8d75304b9554efd68e11ede9f72bed71d0.zip
bridge: T4579: cleanup interface dict (remove empty keys)
(cherry picked from commit 54227591a0eb3c7aa8c896c6ec8b1826ce070ddf)
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/ifconfig/bridge.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/python/vyos/ifconfig/bridge.py b/python/vyos/ifconfig/bridge.py
index d5dbaeb99..eef02f21f 100644
--- a/python/vyos/ifconfig/bridge.py
+++ b/python/vyos/ifconfig/bridge.py
@@ -306,15 +306,13 @@ class BridgeIf(Interface):
# set bridge port path cost
if 'cost' in interface_config:
- value = interface_config.get('cost')
- lower.set_path_cost(value)
+ lower.set_path_cost(interface_config['cost'])
# set bridge port path priority
if 'priority' in interface_config:
- value = interface_config.get('priority')
- lower.set_path_priority(value)
+ lower.set_path_priority(interface_config['priority'])
- if int(vlan_filter):
+ if 'enable_vlan' in config:
add_vlan = []
native_vlan_id = None
allowed_vlan_ids= []
@@ -344,6 +342,7 @@ class BridgeIf(Interface):
for vlan in allowed_vlan_ids:
cmd = f'bridge vlan add dev {interface} vid {vlan} master'
self._cmd(cmd)
+
# Setting native VLAN to system
if native_vlan_id:
cmd = f'bridge vlan add dev {interface} vid {native_vlan_id} pvid untagged master'