1
0
Fork 0
mirror of https://github.com/Luzifer/dns.git synced 2024-12-23 03:11:20 +00:00

Ensure stable sorting in zone files

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-02-18 13:47:31 +01:00
parent 336932ad81
commit 3cbf555584
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
2 changed files with 3 additions and 1 deletions

View file

@ -99,6 +99,8 @@ def sanitize(entry):
result.append(new_entry) result.append(new_entry)
result.sort(key=lambda k: k['data'])
return result return result

View file

@ -9,7 +9,7 @@ $TTL {{ ttl }}
{{ zone }}. {{ ttl }} IN NS {{ ns }} {{ zone }}. {{ ttl }} IN NS {{ ns }}
{% endfor %} {% endfor %}
{%- if mailserver | length > 0 %} {%- if mailserver | length > 0 %}
{% for mailserver, weight in mailserver.items() -%} {% for mailserver, weight in mailserver | dictsort -%}
{{ zone }}. {{ ttl }} IN MX {{ weight }} {{ mailserver }} {{ zone }}. {{ ttl }} IN MX {{ weight }} {{ mailserver }}
{% endfor -%} {% endfor -%}
{%- endif %} {%- endif %}