diff options
| author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2026-01-09 14:55:52 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-09 14:55:52 +0200 |
| commit | 33f1763bf6434497ad0f7904122d5cb943d20138 (patch) | |
| tree | 8f221183536bdfc2879c74f1c81c82cde730295b /python | |
| parent | f80aae18439fe93a32101dfe45ef65812cf91e45 (diff) | |
| parent | a4b3cd33ca11aba579510456941f404839135af4 (diff) | |
| download | vyos-1x-33f1763bf6434497ad0f7904122d5cb943d20138.tar.gz vyos-1x-33f1763bf6434497ad0f7904122d5cb943d20138.zip | |
Merge pull request #4912 from hedrok/T8046-add-link-params-cli
T8046: traffic-engineering: support link-params
Diffstat (limited to 'python')
| -rw-r--r-- | python/vyos/frrender.py | 47 |
1 files changed, 44 insertions, 3 deletions
diff --git a/python/vyos/frrender.py b/python/vyos/frrender.py index f79e6c0f0..1aed31f96 100644 --- a/python/vyos/frrender.py +++ b/python/vyos/frrender.py @@ -51,9 +51,26 @@ ERROR_RELOAD_TEST: str = 'The system encountered an error while rendering the ' 'new routing daemon configuration. To ensure network stability and avoid ' \ 'potential connectivity disruptions, the configuration was not applied!' -frr_protocols = ['babel', 'bfd', 'bgp', 'eigrp', 'isis', 'mpls', 'nhrp', - 'openfabric', 'ospf', 'ospfv3', 'pim', 'pim6', 'rip', - 'ripng', 'rpki', 'segment_routing', 'static'] +frr_protocols = [ + 'babel', + 'bfd', + 'bgp', + 'eigrp', + 'isis', + 'mpls', + 'nhrp', + 'openfabric', + 'ospf', + 'ospfv3', + 'pim', + 'pim6', + 'rip', + 'ripng', + 'rpki', + 'segment_routing', + 'static', + 'traffic_engineering', +] babel_daemon = 'babeld' bfd_daemon = 'bfdd' @@ -426,6 +443,21 @@ def get_frrender_dict(conf: Config, argv=None) -> dict: elif conf.exists_effective(sr_cli_path): dict.update({'segment_routing' : deleted_protocol}) + # We need to check the CLI if the Traffic Engineering node is present and thus load in + # all the default values present on the CLI - that's why we have if conf.exists() + te_cli_path = ['protocols', 'traffic-engineering'] + if conf.exists(te_cli_path): + te = conf.get_config_dict( + te_cli_path, + key_mangling=('-', '_'), + get_first_key=True, + no_tag_node_value_mangle=True, + with_recursive_defaults=True, + ) + dict.update({'traffic_engineering': te}) + elif conf.exists_effective(te_cli_path): + dict.update({'traffic_engineering': deleted_protocol}) + # We need to check the CLI if the static node is present and thus load in # all the default values present on the CLI - that's why we have if conf.exists() static_cli_path = ['protocols', 'static'] @@ -722,6 +754,15 @@ class FRRender: if 'segment_routing' in config_dict and 'deleted' not in config_dict['segment_routing']: output += render_to_string('frr/zebra.segment_routing.frr.j2', config_dict['segment_routing']) output += '\n' + if ( + 'traffic_engineering' in config_dict + and 'deleted' not in config_dict['traffic_engineering'] + ): + output += render_to_string( + 'frr/zebra.traffic_engineering.frr.j2', + config_dict['traffic_engineering'], + ) + output += '\n' if 'static' in config_dict and 'deleted' not in config_dict['static']: output += render_to_string('frr/staticd.frr.j2', config_dict['static']) output += '\n' |
