summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-08-18 09:26:44 +0200
committerChristian Poessinger <christian@poessinger.com>2021-08-18 09:28:19 +0200
commitbd2669f36c2e5a211b9147c50c98155c385bfae7 (patch)
tree6e3eed6144ef73875f8afc02ca033512f92504bc
parent63b755f85afb12ae6b609d76ef7d1b4cc2ff5a98 (diff)
downloadvyos-1x-bd2669f36c2e5a211b9147c50c98155c385bfae7.tar.gz
vyos-1x-bd2669f36c2e5a211b9147c50c98155c385bfae7.zip
ndppd: T2518: add missing if statement for translation address in Jinja2 template
This triggered a bug during smoketesting. File "/usr/share/vyos/templates/proxy-ndp/ndppd.conf.tmpl", line 24, in top-level template code {% if config.translation.address is defined and config.translation.address | is_ip_network %} File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 471, in getattr return getattr(obj, attribute) jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'translation'
-rw-r--r--data/templates/proxy-ndp/ndppd.conf.tmpl8
1 files changed, 4 insertions, 4 deletions
diff --git a/data/templates/proxy-ndp/ndppd.conf.tmpl b/data/templates/proxy-ndp/ndppd.conf.tmpl
index ccd1d37ad..502dab5b8 100644
--- a/data/templates/proxy-ndp/ndppd.conf.tmpl
+++ b/data/templates/proxy-ndp/ndppd.conf.tmpl
@@ -6,10 +6,10 @@
# interface.
#
# For some services, such as nat66, because it runs
-# stateless, it needs to rely on NDP Proxy to respond
+# stateless, it needs to rely on NDP Proxy to respond
# to NDP requests.
#
-# When using nat66 source rules, NDP Proxy needs
+# When using nat66 source rules, NDP Proxy needs
# to be enabled
#
########################################################
@@ -21,7 +21,7 @@
{% if config.outbound_interface not in global.ndppd_interfaces %}
{% set global.ndppd_interfaces = global.ndppd_interfaces + [config.outbound_interface] %}
{% endif %}
-{% if config.translation.address is defined and config.translation.address | is_ip_network %}
+{% if config.translation is defined and config.translation.address is defined and config.translation.address | is_ip_network %}
{% set global.ndppd_prefixs = global.ndppd_prefixs + [{'interface':config.outbound_interface,'rule':config.translation.address}] %}
{% endif %}
{% endif %}
@@ -41,4 +41,4 @@ proxy {{ interface }} {
{% endif %}
{% endfor %}
}
-{% endfor %}
+{% endfor %}