0
0
mirror of https://github.com/saltstack-formulas/sudoers-formula.git synced 2024-11-28 02:57:52 +01:00

dictsort: ensure the dict order is stable

Makes changes easier to read when adding/removing an entry.
Other lines will not be reordered because of unrelated stuffs.
This commit is contained in:
Adrien "ze" Urban 2018-06-25 11:23:49 +02:00
parent 1a46975212
commit bc62b6e567

View File

@ -48,48 +48,48 @@
{% for default in generic_defaults -%} {% for default in generic_defaults -%}
Defaults {{ default }} Defaults {{ default }}
{% endfor %} {% endfor %}
{%- for user,spec in user_list_defaults.items() %} {%- for user,spec in user_list_defaults|dictsort %}
Defaults:{{ user }} {{ spec }} Defaults:{{ user }} {{ spec }}
{%- endfor %} {%- endfor %}
{%- for host,spec in host_list_defaults.items() %} {%- for host,spec in host_list_defaults|dictsort %}
Defaults@{{ host }} {{ spec }} Defaults@{{ host }} {{ spec }}
{%- endfor %} {%- endfor %}
{%- for command,spec in command_list_defaults.items() %} {%- for command,spec in command_list_defaults|dictsort %}
Defaults!{{ command }} {{ spec }} Defaults!{{ command }} {{ spec }}
{%- endfor %} {%- endfor %}
{%- for runas,spec in runas_list_defaults.items() %} {%- for runas,spec in runas_list_defaults|dictsort %}
Defaults>{{ runas }} {{ spec }} Defaults>{{ runas }} {{ spec }}
{%- endfor %} {%- endfor %}
# Host alias specification # Host alias specification
{%- for name,hosts in host_aliases.items() %} {%- for name,hosts in host_aliases|dictsort %}
Host_Alias {{ name }} = {{ ",".join(hosts) }} Host_Alias {{ name }} = {{ ",".join(hosts) }}
{%- endfor %} {%- endfor %}
# User alias specification # User alias specification
{%- for name,users in user_aliases.items() %} {%- for name,users in user_aliases|dictsort %}
User_Alias {{ name }} = {{ ",".join(users) }} User_Alias {{ name }} = {{ ",".join(users) }}
{%- endfor %} {%- endfor %}
# Cmnd alias specification # Cmnd alias specification
{%- for name,commands in command_aliases.items() %} {%- for name,commands in command_aliases|dictsort %}
Cmnd_Alias {{ name }} = {{ ",".join(commands) }} Cmnd_Alias {{ name }} = {{ ",".join(commands) }}
{%- endfor %} {%- endfor %}
# Runas alias specification # Runas alias specification
{%- for name,runas in runas_aliases.items() %} {%- for name,runas in runas_aliases|dictsort %}
Runas_Alias {{ name }} = {{ ",".join(runas) }} Runas_Alias {{ name }} = {{ ",".join(runas) }}
{%- endfor %} {%- endfor %}
# User privilege specification # User privilege specification
{%- for user,specs in users.items() %} {%- for user,specs in users|dictsort %}
{%- for spec in specs %} {%- for spec in specs %}
{{ user }} {{ spec }} {{ user }} {{ spec }}
{%- endfor %} {%- endfor %}
{%- endfor %} {%- endfor %}
# Group privilege specification # Group privilege specification
{%- for group,specs in groups.items() %} {%- for group,specs in groups|dictsort %}
{%- for spec in specs %} {%- for spec in specs %}
%{{ group }} {{ spec }} %{{ group }} {{ spec }}
{%- endfor %} {%- endfor %}