Fix templating error in radvd.conf #805
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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