]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
datamodel/templates: fix error, as RuleSchema doesn't have .log
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 2 Jun 2025 12:42:01 +0000 (14:42 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 3 Jun 2025 07:24:26 +0000 (09:24 +0200)
Also indent the complicated if-nesting.

NEWS
python/knot_resolver/datamodel/templates/macros/local_data_macros.lua.j2

diff --git a/NEWS b/NEWS
index c7e8eb0797b393ff81c3c74b7f872428526f1265..81b270d352e7948334b5ccee5b63f6718f36ce87 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,8 +3,9 @@ Knot Resolver 6.0.14 (2025-06-dd)
 
 Bugfixes
 --------
-- /local-data/addresses*, /local-data/rules/*/subtree: fix 6.0.13 regression (!1697)
-  The error reads as "wrong number of arguments for function call"
+- /local-data/**: fix 6.0.13 regressions (!1697, !1699)
+  The errors read as "wrong number of arguments for function call"
+  or "does not have field named 'log'"
 
 
 Knot Resolver 6.0.13 (2025-05-29)
index 39029b3c729174dba82d93332b5a4e27618bcc3c..92405a5a3ef9fb9ca644432e814f7a4712de65ea 100644 (file)
@@ -71,20 +71,20 @@ assert(C.kr_rule_local_hosts('{{ file }}', {{ boolean(nodata) }},
 {# .opts are complicated #}
 {{ id }}.opts = C.KR_RULE_OPTS_DEFAULT
 {% if extra is not none -%}
-{% if false and extra.dry_run is not none and extra.dry_run -%}
-{{ id }}.opts.score = 4
-{% else %}
-{{ id }}.opts.score = 9
-{% endif %}
-{% if extra.log is not none -%}
-{{ id }}.opts.log_level = 3  -- notice
-{% endif %}
-{% if extra.log is not none and 'ip' in extra.log -%}
-{{ id }}.opts.log_ip = true
-{% endif %}
-{% if extra.log is not none and 'name' in extra.log -%}
-{{ id }}.opts.log_name = true
-{% endif %}
+{%   if false and extra.dry_run is not none and extra.dry_run -%}
+{{     id }}.opts.score = 4
+{%   else %}
+{{     id }}.opts.score = 9
+{%   endif %}
+{%   if 'log' in extra and extra.log is not none -%}
+{{     id }}.opts.log_level = 3  -- notice
+{%     if 'ip' in extra.log -%}
+{{       id }}.opts.log_ip = true
+{%     endif %}
+{%     if 'name' in extra.log -%}
+{{       id }}.opts.log_name = true
+{%     endif %}
+{%   endif %}
 {% endif %}
 assert(C.kr_rule_zonefile({{ id }})==0)
 {%- endmacro %}