diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-08-04 08:28:55 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-08-04 08:28:55 +0200 |
commit | 475fbb785dca76868715827833dc44115635c4a6 (patch) | |
tree | 40315cef20998209b6866403f0677149d0f8611e /python/vyos/configverify.py | |
parent | 17e76dc77801ac58b2587f664c884c0d671a55c0 (diff) | |
download | vyos-1x-475fbb785dca76868715827833dc44115635c4a6.tar.gz vyos-1x-475fbb785dca76868715827833dc44115635c4a6.zip |
vyos.config.configdict: T4592: only print interface name, not interface dict on error
Diffstat (limited to 'python/vyos/configverify.py')
-rw-r--r-- | python/vyos/configverify.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py index ac56da204..2ab3cb408 100644 --- a/python/vyos/configverify.py +++ b/python/vyos/configverify.py @@ -284,15 +284,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): """ |