diff options
author | khramshinr <khramshinr@gmail.com> | 2024-06-12 19:20:45 +0600 |
---|---|---|
committer | khramshinr <khramshinr@gmail.com> | 2024-06-13 16:07:33 +0600 |
commit | aec27085df23bee339bf7ada68283b406a04c3be (patch) | |
tree | 3c6129f98bc5d1d8c13e79d021c3c2ee2eab7854 /src/conf_mode/protocols_isis.py | |
parent | 9cfa2ec772b60b6512815422e3e08cd331f2da33 (diff) | |
download | vyos-1x-aec27085df23bee339bf7ada68283b406a04c3be.tar.gz vyos-1x-aec27085df23bee339bf7ada68283b406a04c3be.zip |
T5725: Improve protocol IS-IS config validation
Diffstat (limited to 'src/conf_mode/protocols_isis.py')
-rwxr-xr-x | src/conf_mode/protocols_isis.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/conf_mode/protocols_isis.py b/src/conf_mode/protocols_isis.py index 0c179b724..f3098ff71 100755 --- a/src/conf_mode/protocols_isis.py +++ b/src/conf_mode/protocols_isis.py @@ -69,6 +69,15 @@ def get_config(config=None): # Merge policy dict into "regular" config dict isis = dict_merge(tmp, isis) + for interface in isis.get('interface'): + # when we use tunnel interface necessary additional config validate + if interface.startswith('tun'): + isis['tunnel_config'] = conf.get_config_dict( + ['interfaces', 'tunnel'], + key_mangling=('-', '_'), + get_first_key=True) + break + return isis def verify(isis): @@ -103,6 +112,10 @@ def verify(isis): f'Recommended area lsp-mtu {recom_area_mtu} or less ' \ '(calculated on MTU size).') + if interface.startswith('tun'): + if not dict_search(f'tunnel_config.{interface}.remote', isis): + raise ConfigError(f'Option remote for interface {interface} is required.') + # If md5 and plaintext-password set at the same time for password in ['area_password', 'domain_password']: if password in isis: |