mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Don't modify self.opts directly
This commit is contained in:
parent
c35ba1f390
commit
a09a60e89b
1 changed files with 4 additions and 3 deletions
|
@ -223,14 +223,15 @@ class CloudClient(object):
|
|||
profile = opts.get('profile', None)
|
||||
# filter other profiles if one is specified
|
||||
if profile:
|
||||
for _profile in [a for a in opts.get('profiles', {})]:
|
||||
tmp_profiles = opts.get('profiles', {}).copy()
|
||||
for _profile in [a for a in tmp_profiles]:
|
||||
if not _profile == profile:
|
||||
opts['profiles'].pop(_profile)
|
||||
tmp_profiles.pop(_profile)
|
||||
# if profile is specified and we have enough info about providers
|
||||
# also filter them to speedup methods like
|
||||
# __filter_non_working_providers
|
||||
providers = [a.get('provider', '').split(':')[0]
|
||||
for a in six.itervalues(opts['profiles'])
|
||||
for a in six.itervalues(tmp_profiles)
|
||||
if a.get('provider', '')]
|
||||
if providers:
|
||||
_providers = opts.get('providers', {})
|
||||
|
|
Loading…
Add table
Reference in a new issue