diff options
author | Jernej Jakob <jernej.jakob@gmail.com> | 2020-05-01 19:53:41 +0200 |
---|---|---|
committer | Jernej Jakob <jernej.jakob@gmail.com> | 2020-05-04 22:59:39 +0200 |
commit | dd50da5f22d18745adafb482ae19ac2455f86cba (patch) | |
tree | 08c9a106acb359676534ce06be1066b0fd8ed194 /src/conf_mode/interfaces-tunnel.py | |
parent | 6866efd1081c39b50a473b58aea61188f4eb6d6e (diff) | |
download | vyos-1x-dd50da5f22d18745adafb482ae19ac2455f86cba.tar.gz vyos-1x-dd50da5f22d18745adafb482ae19ac2455f86cba.zip |
tunnel: T2241: cleanup verify section
- make error output more user friendly
- replace .format with f-strings
- split into lines less than ~80 characters long
Diffstat (limited to 'src/conf_mode/interfaces-tunnel.py')
-rwxr-xr-x | src/conf_mode/interfaces-tunnel.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/conf_mode/interfaces-tunnel.py b/src/conf_mode/interfaces-tunnel.py index 57bc3b8e0..f4cd53981 100755 --- a/src/conf_mode/interfaces-tunnel.py +++ b/src/conf_mode/interfaces-tunnel.py @@ -436,11 +436,14 @@ def verify(conf): if changes['section'] == 'delete': if ifname in options['nhrp']: - raise ConfigError(f'Can not delete interface tunnel {iftype} {ifname}, it is used by nhrp') + raise ConfigError(( + f'Cannot delete interface tunnel {iftype} {ifname}, ' + 'it is used by NHRP')) - bridge = options['bridge'] - if bridge: - raise ConfigError(f'Interface "{ifname}" can not be deleted as it belongs to bridge "{bridge}"!') + if options['bridge']: + raise ConfigError(( + f'Cannot delete interface "{options["ifname"]}" as it is a ' + f'member of bridge "{options["bridge"]}"!')) # done, bail out early return None |