summaryrefslogtreecommitdiff
path: root/data/templates/iproute2/vrf.conf.j2
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2023-01-06 08:14:44 +0100
committerChristian Poessinger <christian@poessinger.com>2023-01-06 08:14:44 +0100
commite32ce63b52eff0255d602b475d90cd97d3b282c1 (patch)
tree4a7f6006374265f40bc3bac4774885ba716dd82d /data/templates/iproute2/vrf.conf.j2
parent5e474ec9c6c7c6fff2a8f1597c16443ec582d4dd (diff)
downloadvyos-1x-e32ce63b52eff0255d602b475d90cd97d3b282c1.tar.gz
vyos-1x-e32ce63b52eff0255d602b475d90cd97d3b282c1.zip
static: T4883: fix KeyError: 'table'
Commit dafb0da2 ("static: T4883: add a description field for routing tables") added an iproute2 description table but lacked checking if the key exists. This has been fixed and also converted to Jinja2 to keep the "common" style inside the routing protocols. It might feel overengineered indeed.
Diffstat (limited to 'data/templates/iproute2/vrf.conf.j2')
-rw-r--r--data/templates/iproute2/vrf.conf.j29
1 files changed, 9 insertions, 0 deletions
diff --git a/data/templates/iproute2/vrf.conf.j2 b/data/templates/iproute2/vrf.conf.j2
new file mode 100644
index 000000000..d31d23574
--- /dev/null
+++ b/data/templates/iproute2/vrf.conf.j2
@@ -0,0 +1,9 @@
+### Autogenerated by vrf.py ###
+#
+# Routing table ID to name mapping reference
+# id vrf name comment
+{% if name is vyos_defined %}
+{% for vrf, vrf_config in name.items() %}
+{{ "%-10s" | format(vrf_config.table) }} {{ "%-16s" | format(vrf) }} {{ '# ' ~ vrf_config.description if vrf_config.description is vyos_defined }}
+{% endfor %}
+{% endif %}