From ce07b0e75da4c01f4a460a040010d8bd753abd10 Mon Sep 17 00:00:00 2001 From: "derrick.birkes" Date: Tue, 10 Jun 2014 15:22:55 -0600 Subject: [PATCH] A deep copy should be used for default options. Use deep copy to get default master and minion options to avoid altering them. This fixes an issue encountered when defining grains for multiple nodes in a salt-cloud map file. Nodes deployed later in the process were getting grains for previously deployed nodes. --- salt/utils/cloud.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/utils/cloud.py b/salt/utils/cloud.py index 2522c91076..d118501cdf 100644 --- a/salt/utils/cloud.py +++ b/salt/utils/cloud.py @@ -188,7 +188,7 @@ def minion_config(opts, vm_): ''' # Let's get a copy of the salt minion default options - minion = salt.config.DEFAULT_MINION_OPTS.copy() + minion = copy.deepcopy(salt.config.DEFAULT_MINION_OPTS) # Some default options are Null, let's set a reasonable default minion.update( log_level='info', @@ -233,7 +233,7 @@ def master_config(opts, vm_): Return a master's configuration for the provided options and VM ''' # Let's get a copy of the salt master default options - master = salt.config.DEFAULT_MASTER_OPTS.copy() + master = copy.deepcopy(salt.config.DEFAULT_MASTER_OPTS) # Some default options are Null, let's set a reasonable default master.update( log_level='info',