diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-03-05 20:25:20 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-03-05 20:25:20 +0100 |
commit | d3f79422514d65d19dc2b1085f0e19c51f831be7 (patch) | |
tree | 6a69f26605d3ad3a3890d127ad554a71eeab9577 | |
parent | ff52634f1d24356ffcd694a226f5313919b996e5 (diff) | |
download | vyos-1x-d3f79422514d65d19dc2b1085f0e19c51f831be7.tar.gz vyos-1x-d3f79422514d65d19dc2b1085f0e19c51f831be7.zip |
vrf: T31: routing table IDs must be unique
-rwxr-xr-x | src/conf_mode/vrf.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/conf_mode/vrf.py b/src/conf_mode/vrf.py index 116d87455..bdd57177c 100755 --- a/src/conf_mode/vrf.py +++ b/src/conf_mode/vrf.py @@ -148,16 +148,20 @@ def verify(vrf_config): if len(vrf['members']) > 0: raise ConfigError('VRF "{}" can not be deleted as it has active members'.format(vrf['name'])) + 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('VRF "{}" table id is mandatory'.format(vrf['name'])) # routing table id can't be changed - OS restriction if vrf['table_mod']: - raise ConfigError('VRF "{}": modification of table id is not possible'.format(vrf['name'])) + raise ConfigError('VRF "{}" modification of table id is not possible'.format(vrf['name'])) - # add test to see if routing table already exists or not? + # VRf routing table ID must be unique on the system + if vrf['table'] in table_ids: + raise ConfigError('VRF "{}" routing table id "{}" not unique'.format(vrf['name'], vrf['table'])) + table_ids.append(vrf['table']) return None |