From 722fbde7d07c736067e066f24770bd6e57f2e01d Mon Sep 17 00:00:00 2001 From: schrc3b6 Date: Fri, 28 Jul 2023 16:03:49 +0200 Subject: [PATCH] Fix templating error in radvd.conf When configuring radvd service an undefined object error is thrown. The data function in RadvdService returns a dict with ifaces. The radvd template however, expects a dict with a values key. I changed the key in the template because "ifaces" is way more descriptive than "values". Original Error that is fixed: Traceback (most recent call last): File "/opt/core/venv/lib/python3.9/site-packages/core/configservice/base.py", line 471, in render_template return self._render(template, data) File "/opt/core/venv/lib/python3.9/site-packages/core/configservice/base.py", line 439, in _render return template.render_unicode( File "/opt/core/venv/lib/python3.9/site-packages/mako/template.py", line 444, in render_unicode return runtime._render( File "/opt/core/venv/lib/python3.9/site-packages/mako/runtime.py", line 874, in _render _render_context( File "/opt/core/venv/lib/python3.9/site-packages/mako/runtime.py", line 916, in _render_context _exec_template(inherit, lclcontext, args=args, kwargs=kwargs) File "/opt/core/venv/lib/python3.9/site-packages/mako/runtime.py", line 943, in _exec_template callable_(context, *args, **kwargs) File "/opt/core/venv/lib/python3.9/site-packages/core/configservices/utilservices/templates/etc/radvd/radvd.conf", line 2, in render_body % for ifname, prefixes in values: TypeError: 'Undefined' object is not iterable --- .../configservices/utilservices/templates/etc/radvd/radvd.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/core/configservices/utilservices/templates/etc/radvd/radvd.conf b/daemon/core/configservices/utilservices/templates/etc/radvd/radvd.conf index 1436f068..d003b4b1 100644 --- a/daemon/core/configservices/utilservices/templates/etc/radvd/radvd.conf +++ b/daemon/core/configservices/utilservices/templates/etc/radvd/radvd.conf @@ -1,5 +1,5 @@ # auto-generated by RADVD service (utility.py) -% for ifname, prefixes in values: +% for ifname, prefixes in ifaces: interface ${ifname} { AdvSendAdvert on;