Skip to content
Snippets Groups Projects
Commit 79d337f4 authored by skorpy's avatar skorpy :construction_worker:
Browse files

remove sorting of dict

parent 9f126b44
Branches
No related tags found
1 merge request!450Resolve "python3 fix modules "unorderable types: dict() < dict()""
Pipeline #21939 passed
def prometheus_targets_for_grain(key):
values = __salt__['mine.get']('*', 'grains.items', tgt_type='glob').values()
return [ remote_grains[key] for remote_grains in sorted(values) if key in remote_grains ]
return [ remote_grains[key] for remote_grains in values if key in remote_grains ]
......@@ -21,7 +21,7 @@ iface lo
{#
# Set up ifaces dict with configured and generated interfaces.
#}
{%- for interface in ifaces|sort if interface not in ['lo'] %}
{%- for interface in ifaces if interface not in ['lo'] %}
{%- set config = ifaces.get (interface) %}
{#- Let's go #}
......@@ -42,7 +42,7 @@ iface {{ interface }}
{#- Configure stuff for bonding, bridging, etc.? #}
{%- for feature in ['batman', 'bond', 'bridge', 'vlan', 'vxlan'] if feature in config %}
{%- set feature_config = config.get (feature) %}
{%- for opt in feature_config|sort %}
{%- for opt in feature_config %}
{{ opt }} {{ feature_config.get (opt) }}
{%- endfor %}
#
......@@ -54,7 +54,7 @@ iface {{ interface }}
{%- endfor %}
{#- Anything else... #}
{%- for keyword in config|sort %}
{%- for keyword in config %}
{%- set argument = config.get (keyword) %}
{%- if argument is none %}
{%- elif keyword.startswith ("_") %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment