summaryrefslogtreecommitdiff
path: root/python/vyos/configverify.py
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2022-08-22 13:56:37 +0100
committerGitHub <noreply@github.com>2022-08-22 13:56:37 +0100
commit7cd7b6e27c29f72b79979f4d6f999def89309504 (patch)
tree43859c36bca1c0837ecbdaa33bb0ffb756b45e15 /python/vyos/configverify.py
parentdc0e468046bef4aef3ee81eec23c3703e0b5da85 (diff)
parent12c9c19a2f4f55ab1d7a70b496473ac41212c510 (diff)
downloadvyos-1x-7cd7b6e27c29f72b79979f4d6f999def89309504.tar.gz
vyos-1x-7cd7b6e27c29f72b79979f4d6f999def89309504.zip
Merge pull request #1480 from c-po/t4629-equuleus
T4629: Raised ConfigErrors contain dict instead of only the dict key (equuleus)
Diffstat (limited to 'python/vyos/configverify.py')
-rw-r--r--python/vyos/configverify.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py
index 356246053..d4b532d22 100644
--- a/python/vyos/configverify.py
+++ b/python/vyos/configverify.py
@@ -237,15 +237,16 @@ def verify_source_interface(config):
raise ConfigError('Specified source-interface {source_interface} does '
'not exist'.format(**config))
+ src_ifname = config['source_interface']
if 'source_interface_is_bridge_member' in config:
- raise ConfigError('Invalid source-interface {source_interface}. Interface '
- 'is already a member of bridge '
- '{source_interface_is_bridge_member}'.format(**config))
+ bridge_name = next(iter(config['source_interface_is_bridge_member']))
+ raise ConfigError(f'Invalid source-interface "{src_ifname}". Interface '
+ f'is already a member of bridge "{bridge_name}"!')
if 'source_interface_is_bond_member' in config:
- raise ConfigError('Invalid source-interface {source_interface}. Interface '
- 'is already a member of bond '
- '{source_interface_is_bond_member}'.format(**config))
+ bond_name = next(iter(config['source_interface_is_bond_member']))
+ raise ConfigError(f'Invalid source-interface "{src_ifname}". Interface '
+ f'is already a member of bond "{bond_name}"!')
def verify_dhcpv6(config):
"""