From: Vladimír Čunát Date: Mon, 2 Jun 2025 12:42:01 +0000 (+0200) Subject: datamodel/templates: fix error, as RuleSchema doesn't have .log X-Git-Tag: v6.0.14~1^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=20c484f9b8bbbec3d8e210c1d7035a42c299cd4f;p=thirdparty%2Fknot-resolver.git datamodel/templates: fix error, as RuleSchema doesn't have .log Also indent the complicated if-nesting. --- diff --git a/NEWS b/NEWS index c7e8eb079..81b270d35 100644 --- 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) diff --git a/python/knot_resolver/datamodel/templates/macros/local_data_macros.lua.j2 b/python/knot_resolver/datamodel/templates/macros/local_data_macros.lua.j2 index 39029b3c7..92405a5a3 100644 --- a/python/knot_resolver/datamodel/templates/macros/local_data_macros.lua.j2 +++ b/python/knot_resolver/datamodel/templates/macros/local_data_macros.lua.j2 @@ -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 %}