]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
datamodel: local_data_records(): swap argument order
authorVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 30 Aug 2023 09:43:00 +0000 (11:43 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 12 Sep 2023 10:12:55 +0000 (12:12 +0200)
Everywhere else we order `nodata` parameter before `ttl`.
Let's make it consistent to reduce potential for confusion.

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

index 31b0f78b6c704d7d481a7ffde1fc25b43564054e..8882471fd9df94af05a337260716e81d4c59ae8c 100644 (file)
@@ -25,7 +25,7 @@ modules = { 'hints > iterate' }
 
 {# records #}
 {% if cfg.local_data.records -%}
-{{ local_data_records(cfg.local_data.records, false, cfg.local_data.ttl, cfg.local_data.nodata) }}
+{{ local_data_records(cfg.local_data.records, false, cfg.local_data.nodata, cfg.local_data.ttl) }}
 {%- endif %}
 
 {# rules #}
@@ -36,6 +36,6 @@ modules = { 'hints > iterate' }
 {# rpz #}
 {% if cfg.local_data.rpz -%}
 {% for rpz in cfg.local_data.rpz %}
-{{ local_data_records(rpz.file, true, cfg.local_data.ttl, cfg.local_data.nodata, rpz.tags) }}
+{{ local_data_records(rpz.file, true, cfg.local_data.nodata, cfg.local_data.ttl, rpz.tags) }}
 {% endfor %}
 {%- endif %}
index d3596490f89c33bcd6caa2af61abae44cc1cd480..809fe25ce57b9cee53a5f660ed02169b286b7858 100644 (file)
@@ -54,7 +54,7 @@ assert(C.kr_rule_local_hosts('{{ file }}', {{ boolean(nodata) }},
 {%- endmacro %}
 
 
-{% macro local_data_records(input_str, is_rpz, ttl, nodata, tags=none, id='rrs') -%}
+{% macro local_data_records(input_str, is_rpz, nodata, ttl, tags=none, id='rrs') -%}
 {{ id }} = ffi.new('struct kr_rule_zonefile_config')
 {{ id }}.ttl = {{ local_data_ttl(ttl) }}
 {{ id }}.tags = {{ policy_get_tagset(tags) }}
@@ -95,7 +95,7 @@ assert(C.kr_rule_local_subtree(todname('{{ name }}'),
 {{ kr_rule_local_hosts(file, nodata if item.nodata is none else item.nodata, item.ttl or ttl, item.tags) }}
 {% endfor %}
 {% elif item.records %}
-{{ local_data_records(item.records, false, item.ttl or ttl, nodata if item.nodata is none else item.nodata, tags) }}
+{{ local_data_records(item.records, false, nodata if item.nodata is none else item.nodata, item.ttl or ttl, tags) }}
 {% endif %}
 {% endfor %}
 {%- endmacro %}