Skip to content

Commit 7f50076

Browse files
committed
Use dictsort instead of iteritems
to process entries in deterministic order
1 parent 353a8df commit 7f50076

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

bind/files/named.conf.local.jinja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ logging {
129129

130130
{%- if salt['pillar.get']('bind:controls', False) %}
131131
controls {
132-
{%- for name, control in salt['pillar.get']('bind:controls').iteritems() if control.get('enabled', True) %}
132+
{%- for name, control in salt['pillar.get']('bind:controls')|dictsort if control.get('enabled', True) %}
133133
inet {{ control.get('bind', {}).get('address', '127.0.0.1') }} port {{ control.get('bind', {}).get('port', 953) }}
134134
{%- if control.get('allow') %}
135135
allow {
@@ -151,7 +151,7 @@ controls {
151151

152152
{%- if salt['pillar.get']('bind:statistics', False) %}
153153
statistics-channels {
154-
{%- for name, channel in salt['pillar.get']('bind:statistics').iteritems() if channel.get('enabled', True) %}
154+
{%- for name, channel in salt['pillar.get']('bind:statistics')|dictsort if channel.get('enabled', True) %}
155155
inet {{ channel.get('bind', {}).get('address', '127.0.0.1') }} port {{ channel.get('bind', {}).get('port', 953) }}
156156
{%- if channel.get('allow') %}
157157
allow {

bind/files/zone.jinja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ $TTL {{ soa['ttl'] }}
2828
{% if include %}
2929
$INCLUDE {{ include }}
3030
{% else %}
31-
{% for type, rrs in records.iteritems() %}
31+
{% for type, rrs in records|dictsort %}
3232
;
3333
; {{ type }} RRs
3434
;
35-
{%- for host, data in rrs.iteritems() %}
35+
{%- for host, data in rrs|dictsort %}
3636
{%- if data is number or data is string %}
3737
{{ host }} {{ type }} {{ data }}
3838
{%- elif data is iterable %}

0 commit comments

Comments
 (0)