From 2f2cd972ac9db7704ca5a28ece521842a7e6fdf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Hertzog?= Date: Tue, 23 Dec 2014 17:35:26 +0100 Subject: [PATCH] Use items() method to loop over nodegroups/log_granular_levels dictionaries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise you get an “ValueError: too many values to unpack” exception when you make use of those entries in your pillar data. --- salt/files/master.d/_defaults.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/salt/files/master.d/_defaults.conf b/salt/files/master.d/_defaults.conf index 9d363bb..84e0509 100644 --- a/salt/files/master.d/_defaults.conf +++ b/salt/files/master.d/_defaults.conf @@ -869,12 +869,12 @@ peer_run: # {% if 'log_granular_levels' in master %} log_granular_levels: - {% for name, lvl in master['log_granular_levels'] %} + {% for name, lvl in master['log_granular_levels'].items() %} {{ name }}: {{ lvl }} {% endfor %} {% elif 'log_granular_levels' in salt %} log_granular_levels: - {% for name, lvl in salt['log_granular_levels'] %} + {% for name, lvl in salt['log_granular_levels'].items() %} {{ name }}: {{ lvl }} {% endfor %} {% else %} @@ -891,12 +891,12 @@ log_granular_levels: # group2: 'G@os:Debian and foo.domain.com' {% if 'nodegroups' in master %} nodegroups: - {% for name, lvl in master['nodegroups'] %} + {% for name, lvl in master['nodegroups'].items() %} {{ name }}: {{ lvl }} {% endfor %} {% elif 'nodegroups' in salt %} nodegroups: - {% for name, lvl in salt['nodegroups'] %} + {% for name, lvl in salt['nodegroups'].items() %} {{ name }}: {{ lvl }} {% endfor %} {% endif %}