diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-10-12 09:15:45 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-10-12 09:18:18 +0200 |
commit | 1c16a56e7b29da98e9e753d6e64d2417359a4ced (patch) | |
tree | 4451bceb80dc59b89aeb35f14611542d58ea4168 | |
parent | 6951fa7ef6ea4a2715b9083d654f6cf3f3b60213 (diff) | |
download | vyos-1x-1c16a56e7b29da98e9e753d6e64d2417359a4ced.tar.gz vyos-1x-1c16a56e7b29da98e9e753d6e64d2417359a4ced.zip |
ospf: T4707: fix segment-routing Jinja2 template for explicit-null and no-php-flag
The nested if statement was not properly evaluated during smoketests making
them fail. There is no need to nest the if's - as a simple string can be
appended by {{ 'foo' if bar is vyos_defined }}
-rw-r--r-- | data/templates/frr/ospfd.frr.j2 | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/data/templates/frr/ospfd.frr.j2 b/data/templates/frr/ospfd.frr.j2 index 9cd9b03dc..2a8afefbc 100644 --- a/data/templates/frr/ospfd.frr.j2 +++ b/data/templates/frr/ospfd.frr.j2 @@ -196,12 +196,7 @@ router ospf {{ 'vrf ' ~ vrf if vrf is vyos_defined }} {% for prefix, prefix_config in segment_routing.prefix.items() %} {% if prefix_config.index is vyos_defined %} {% if prefix_config.index.value is vyos_defined %} - segment-routing prefix {{ prefix }} index {{ prefix_config.index.value }} -{% if prefix_config.index.explicit_null is vyos_defined %} - segment-routing prefix {{ prefix }} index {{ prefix_config.index.value }} explicit-null -{% elif prefix_config.index.no_php_flag is vyos_defined %} - segment-routing prefix {{ prefix }} index {{ prefix_config.index.value }} no-php-flag -{% endif %} + segment-routing prefix {{ prefix }} index {{ prefix_config.index.value }} {{ 'explicit-null' if prefix_config.index.explicit_null is vyos_defined }} {{ 'no-php-flag' if prefix_config.index.no_php_flag is vyos_defined }} {% endif %} {% endif %} {% endfor %} |