summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-02-13 21:54:22 +0100
committerChristian Breunig <christian@breunig.cc>2024-02-13 21:55:30 +0100
commit399d3b7f786e3b9a7a9dd1ec4ffdc0d7cd246d7e (patch)
tree29751dd638c22921f539216898d3f0ebf708441e /python/vyos
parentf583773faf67b3b1227681ff12e418f6fdc5a0fa (diff)
downloadvyos-1x-399d3b7f786e3b9a7a9dd1ec4ffdc0d7cd246d7e.tar.gz
vyos-1x-399d3b7f786e3b9a7a9dd1ec4ffdc0d7cd246d7e.zip
configverify: T3992: fix KeyError in verify_address()
Reproducible by: set interfaces bridge br0 member interface eth1.10 set interfaces ethernet eth1 vif 10 address 100.64.0.1/24 File "/usr/lib/python3/dist-packages/vyos/configverify.py", line 314, in verify_vlan_config verify_address(vlan) File "/usr/lib/python3/dist-packages/vyos/configverify.py", line 206, in verify_address interface = config['ifname'] KeyError: 'ifname'
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/configverify.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py
index 6afb1c596..a2ddf01dd 100644
--- a/python/vyos/configverify.py
+++ b/python/vyos/configverify.py
@@ -203,10 +203,9 @@ def verify_address(config):
of a bridge or bond.
"""
if {'is_bridge_member', 'address'} <= set(config):
- interface = config['ifname']
bridge_name = next(iter(config['is_bridge_member']))
- raise ConfigError(f'Cannot assign address to interface "{interface}" '
- f'as it is a member of bridge "{bridge_name}"!')
+ raise ConfigError(f'Cannot assign address to interface which '
+ f'is a member of bridge "{bridge_name}"!')
def verify_bridge_delete(config):
"""