diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-10-16 18:04:15 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-10-16 18:04:15 +0200 |
| commit | 1f482caab97b76e3acb4e675f15011649821a4c2 (patch) | |
| tree | 98d8b7eefb12e6e481c7e15761978a46e0a55dfd /python | |
| parent | 8302a96fd1b45afcd8550883b729d4907a723e0f (diff) | |
| parent | 6e3598a23b22462c59635cac4f367987c253277b (diff) | |
| download | vyos-1x-1f482caab97b76e3acb4e675f15011649821a4c2.tar.gz vyos-1x-1f482caab97b76e3acb4e675f15011649821a4c2.zip | |
Merge pull request #5560 from alexandr-san4ez/T9346-rolling_validation-fix
policy: T9346: Allow dot in `prefix-list` and `prefix-list6` names
Diffstat (limited to 'python')
| -rw-r--r-- | python/vyos/configverify.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py index 89f1b7ad7..d918c53bb 100644 --- a/python/vyos/configverify.py +++ b/python/vyos/configverify.py @@ -439,10 +439,9 @@ def verify_common_route_maps(config): for route_map in ['route-map', 'route_map']: if route_map not in config: continue - tmp = config[route_map] + route_map_name = config[route_map] # Check if the specified route-map exists, if not error out - if dict_search(f'policy.route_map.{tmp}', config) == None: - raise ConfigError(f'Specified route-map "{tmp}" does not exist!') + verify_route_map(route_map_name, config) if 'redistribute' in config: for protocol, protocol_config in config['redistribute'].items(): @@ -454,8 +453,10 @@ def verify_route_map(route_map_name, config): Common helper function used by routing protocol implementations to perform recurring validation if a specified route-map exists! """ + # Check if the specified route-map exists, if not error out - if dict_search(f'policy.route_map.{route_map_name}', config) == None: + route_maps = dict_search('policy.route_map', config) or {} + if route_map_name not in route_maps: raise ConfigError(f'Specified route-map "{route_map_name}" does not exist!') def verify_prefix_list(prefix_list, config, version=''): @@ -463,8 +464,10 @@ def verify_prefix_list(prefix_list, config, version=''): Common helper function used by routing protocol implementations to perform recurring validation if a specified prefix-list exists! """ + # Check if the specified prefix-list exists, if not error out - if dict_search(f'policy.prefix_list{version}.{prefix_list}', config) == None: + prefixes = dict_search(f'policy.prefix_list{version}', config) or {} + if prefix_list not in prefixes: raise ConfigError(f'Specified prefix-list{version} "{prefix_list}" does not exist!') def verify_access_list(access_list, config, version=''): |
