From 399d3b7f786e3b9a7a9dd1ec4ffdc0d7cd246d7e Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Tue, 13 Feb 2024 21:54:22 +0100 Subject: 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' --- python/vyos/configverify.py | 5 ++--- 1 file 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): """ -- cgit v1.2.3