]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
datamodel/templates: fix kr_rule_local_* macros
authorBrad Cowie <brad@faucet.nz>
Fri, 30 May 2025 01:57:25 +0000 (13:57 +1200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 30 May 2025 04:56:38 +0000 (06:56 +0200)
commit a782e9c3 broke the jinja2 generation of the
kr_rule_local_* macro functions. C.KR_RULE_OPTS_DEFAULT
was provided as an argument to the assert() function call
instead of the call to the corresponding C.kr_rule_local_* function

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

index e91b82685c61213348511421b78d3aea9f02494f..39029b3c729174dba82d93332b5a4e27618bcc3c 100644 (file)
@@ -28,8 +28,8 @@ hints.root_file('{{ file }}')
 
 {% macro kr_rule_local_address(name, address, nodata, ttl, tags=none) -%}
 assert(C.kr_rule_local_address('{{ name }}', '{{ address }}',
-    {{ boolean(nodata) }}, {{ local_data_ttl(ttl)}}, {{ policy_get_tagset(tags) }}) == 0,
-    C.KR_RULE_OPTS_DEFAULT)
+    {{ boolean(nodata) }}, {{ local_data_ttl(ttl)}}, {{ policy_get_tagset(tags) }},
+    C.KR_RULE_OPTS_DEFAULT) == 0)
 {%- endmacro -%}
 
 
@@ -44,7 +44,7 @@ assert(C.kr_rule_local_address('{{ name }}', '{{ address }}',
 
 {% macro kr_rule_local_hosts(file, nodata, ttl, tags=none) -%}
 assert(C.kr_rule_local_hosts('{{ file }}', {{ boolean(nodata) }},
-    {{ local_data_ttl(ttl)}}, {{ policy_get_tagset(tags) }}) == 0, C.KR_RULE_OPTS_DEFAULT)
+    {{ local_data_ttl(ttl)}}, {{ policy_get_tagset(tags) }}, C.KR_RULE_OPTS_DEFAULT) == 0)
 {%- endmacro %}
 
 
@@ -92,8 +92,8 @@ assert(C.kr_rule_zonefile({{ id }})==0)
 
 {% macro kr_rule_local_subtree(name, type, ttl, tags=none) -%}
 assert(C.kr_rule_local_subtree(todname('{{ name }}'),
-    C.KR_RULE_SUB_{{ type.upper() }}, {{ local_data_ttl(ttl) }}, {{ policy_get_tagset(tags) }}) == 0,
-    C.KR_RULE_OPTS_DEFAULT)
+    C.KR_RULE_SUB_{{ type.upper() }}, {{ local_data_ttl(ttl) }}, {{ policy_get_tagset(tags) }},
+    C.KR_RULE_OPTS_DEFAULT) == 0)
 {%- endmacro %}