From 791025e065ab1f52a311ef1cfc526677a4cedfb9 Mon Sep 17 00:00:00 2001 From: Johannes Date: Fri, 3 Oct 2014 09:43:59 +0100 Subject: [PATCH] Avoid config key clashes Fixes #48 --- salt/files/master | 3 ++- salt/files/minion | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/salt/files/master b/salt/files/master index 60f545e..d1b97e1 100644 --- a/salt/files/master +++ b/salt/files/master @@ -1,11 +1,12 @@ # This file managed by Salt, do not edit by hand!! # Based on salt version 0.17.4 default config +{% set reserved_keys = ['master', 'minion', 'cloud', 'salt_cloud_certs'] -%} {% set salt = pillar.get('salt', {}) -%} {% set master = salt.get('master', {}) -%} {%- macro get_config(configname, default_value) -%} {%- if configname in master -%} {{ configname }}: {{ master[configname] }} -{%- elif configname in salt -%} +{%- elif configname in salt and configname not in reserved_keys -%} {{ configname }}: {{ salt[configname] }} {%- else -%} #{{ configname }}: {{ default_value }} diff --git a/salt/files/minion b/salt/files/minion index 67ca28b..2332df6 100644 --- a/salt/files/minion +++ b/salt/files/minion @@ -1,11 +1,12 @@ # This file managed by Salt, do not edit by hand!! # Based on salt version 0.17.4 default config +{% set reserved_keys = ['master', 'minion', 'cloud', 'salt_cloud_certs'] -%} {% set salt = pillar.get('salt', {}) -%} {% set minion = salt.get('minion', {}) -%} {%- macro get_config(configname, default_value) -%} {%- if configname in minion -%} {{ configname }}: {{ minion[configname] }} -{%- elif configname in salt -%} +{%- elif configname in salt and configname not in reserved_keys -%} {{ configname }}: {{ salt[configname] }} {%- else -%} #{{ configname }}: {{ default_value }}