mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix providers handling
This fixes #24017 Signed-off-by: Mathieu Le Marec - Pasquet <kiorky@cryptelium.net>
This commit is contained in:
parent
63164900bd
commit
412b39b802
1 changed files with 13 additions and 7 deletions
|
@ -161,14 +161,20 @@ def minion_mods(
|
|||
# Load any provider overrides from the configuration file providers option
|
||||
# Note: Providers can be pkg, service, user or group - not to be confused
|
||||
# with cloud providers.
|
||||
if opts.get('providers', False):
|
||||
providers = opts.get('providers', False)
|
||||
providers = opts.get('providers', False)
|
||||
if providers and isinstance(providers, dict):
|
||||
for mod in providers:
|
||||
funcs = raw_mod(opts, providers[mod], ret.items())
|
||||
if funcs:
|
||||
for func in funcs:
|
||||
f_key = '{0}{1}'.format(mod, func[func.rindex('.'):])
|
||||
ret[f_key] = funcs[func]
|
||||
# sometimes providers opts is not to diverge modules but
|
||||
# for other configuration
|
||||
try:
|
||||
funcs = raw_mod(opts, providers[mod], ret.items())
|
||||
except TypeError:
|
||||
break
|
||||
else:
|
||||
if funcs:
|
||||
for func in funcs:
|
||||
f_key = '{0}{1}'.format(mod, func[func.rindex('.'):])
|
||||
ret[f_key] = funcs[func]
|
||||
|
||||
ret.pack['__salt__'] = ret
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue