mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #12934 from gtmanfred/develop
do deep copy before creating CloudClient
This commit is contained in:
commit
a7d578aaee
@ -178,19 +178,18 @@ class CloudClient(object):
|
||||
self.opts = salt.config.cloud_config(path)
|
||||
|
||||
if pillars:
|
||||
cloud_args = pillars.copy()
|
||||
for name, provider in cloud_args.pop('providers', {}).items():
|
||||
for name, provider in pillars.pop('providers', {}).items():
|
||||
driver = provider['provider']
|
||||
provider['profiles'] = {}
|
||||
self.opts['providers'].update({name: {driver: provider}})
|
||||
for name, profile in cloud_args.pop('profiles', {}).items():
|
||||
for name, profile in pillars.pop('profiles', {}).items():
|
||||
provider = profile['provider'].split(':')[0]
|
||||
driver = self.opts['providers'][provider].keys()[0]
|
||||
profile['provider'] = '{0}:{1}'.format(provider, driver)
|
||||
profile['profile'] = name
|
||||
self.opts['profiles'].update({name: profile})
|
||||
self.opts['providers'][provider][driver]['profiles'].update({name: profile})
|
||||
self.opts.update(cloud_args)
|
||||
self.opts.update(pillars)
|
||||
|
||||
def _opts_defaults(self, **kwargs):
|
||||
'''
|
||||
|
@ -38,7 +38,7 @@ def _get_client():
|
||||
'''
|
||||
client = salt.cloud.CloudClient(
|
||||
os.path.join(os.path.dirname(__opts__['conf_file']), 'cloud'),
|
||||
pillars=__salt__['pillar.get']('cloud', {})
|
||||
pillars=copy.deepcopy(__pillar__.get('cloud', {}))
|
||||
)
|
||||
return client
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user