diff --git a/salt/cloud/__init__.py b/salt/cloud/__init__.py index 566b75a5fa..745e4e87ee 100644 --- a/salt/cloud/__init__.py +++ b/salt/cloud/__init__.py @@ -1910,7 +1910,7 @@ class Map(Cloud): pmap = self.map_providers_parallel(cached=cached) exist = set() defined = set() - for profile_name, nodes in six.iteritems(self.rendered_map): + for profile_name, nodes in six.iteritems(copy.deepcopy(self.rendered_map)): if profile_name not in self.opts['profiles']: msg = ( 'The required profile, \'{0}\', defined in the map ' @@ -1931,13 +1931,13 @@ class Map(Cloud): # Get associated provider data, in case something like size # or image is specified in the provider file. See issue #32510. alias, driver = profile_data.get('provider').split(':') - provider_details = self.opts['providers'][alias][driver].copy() + provider_details = copy.deepcopy(self.opts['providers'][alias][driver]) del provider_details['profiles'] # Update the provider details information with profile data # Profile data should override provider data, if defined. # This keeps map file data definitions consistent with -p usage. - provider_details.update(profile_data) + salt.utils.dictupdate.update(provider_details, profile_data) profile_data = provider_details for nodename, overrides in six.iteritems(nodes):