summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-03-07 10:08:31 +0100
committerChristian Poessinger <christian@poessinger.com>2020-03-07 10:08:31 +0100
commit3b7b0a89f4407e3b9c571d80226fb9b191ffb386 (patch)
treeec853648f6aa4da0f628bdc03e49da3f11b05dc7 /src/conf_mode
parentbfd90c6aef059e7513d804f99bef00fa96c4cdb7 (diff)
downloadvyos-1x-3b7b0a89f4407e3b9c571d80226fb9b191ffb386.tar.gz
vyos-1x-3b7b0a89f4407e3b9c571d80226fb9b191ffb386.zip
vrf: T31: move to Python3 f-strings where possible
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/vrf.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/conf_mode/vrf.py b/src/conf_mode/vrf.py
index 6b53d052a..991c5cb2c 100755
--- a/src/conf_mode/vrf.py
+++ b/src/conf_mode/vrf.py
@@ -169,24 +169,25 @@ def verify(vrf_config):
# ensure VRF is not assigned to any interface
for vrf in vrf_config['vrf_remove']:
if len(vrf['interfaces']) > 0:
- raise ConfigError('VRF {} can not be deleted. It has active member interfaces!'.format(vrf['name']))
+ raise ConfigError(f"VRF {vrf['name']} can not be deleted. It has active member interfaces!")
if len(vrf['routes']) > 0:
- raise ConfigError('VRF {} can not be deleted. It has routing protocols attached!'.format(vrf['name']))
+ raise ConfigError(f"VRF {vrf['name']} can not be deleted. It has active routing protocols!")
table_ids = []
for vrf in vrf_config['vrf_add']:
# table id is mandatory
if not vrf['table']:
- raise ConfigError('VRF {} table id is mandatory!'.format(vrf['name']))
+ raise ConfigError(f"VRF {vrf['name']} table id is mandatory!")
# routing table id can't be changed - OS restriction
if vrf['table_mod']:
- raise ConfigError('VRF {} table id modification is not possible!'.format(vrf['name']))
+ raise ConfigError(f"VRF {vrf['name']} table id modification is not possible!")
# VRf routing table ID must be unique on the system
if vrf['table'] in table_ids:
- raise ConfigError('VRF {} table id "{}" is not unique!'.format(vrf['name'], vrf['table']))
+ raise ConfigError(f"VRF {vrf['name']} table id {vrf['table']} is not unique!")
+
table_ids.append(vrf['table'])
return None