Merge pull request #47665 from gtmanfred/cloud

use dictupdate to update the providers dictionary and merge lists
This commit is contained in:
Nicole Thomas 2018-05-16 11:59:16 -04:00 committed by GitHub
commit 990ece5cd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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):