]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
manager /local-data/addresses*: be stricter about errors
authorVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 15 Jun 2023 09:31:57 +0000 (11:31 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 15 Jun 2023 09:35:00 +0000 (11:35 +0200)
In versions before 6.x these errors intentionally didn't cause
the startup fail, but I think we can be more strict now.

manager/knot_resolver_manager/datamodel/templates/macros/local_data_macros.lua.j2

index 27064d736136259ffdecf1b2749b6fac73b483ff..c3104b7de059f86cccf642880aef32bcbf349552 100644 (file)
@@ -20,14 +20,14 @@ hints.root_file('{{ file }}')
 
 {% macro local_data_addresses(pairs) -%}
 {% for name, address in pairs.items() %}
-hints['{{ name }}'] = '{{ address }}'
+assert(hints.set('{{ name }} {{ address }}').result == true)
 {% endfor %}
 {%- endmacro %}
 
 
 {% macro local_data_addresses_files(files) -%}
 {% for file in files %}
-hints.add_hosts('{{ file }}')
+assert(hints.add_hosts('{{ file }}').result == true)
 {% endfor %}
 {%- endmacro %}