mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
When pulling values out of the available configuration for returners we should always default to using keys for those returners, eg. mongo.user for the username. Otherwise in certain situations, eg. when using salt-ssh we will end up with the wrong value for the user.
This commit is contained in:
parent
afbcf031bb
commit
35254116f3
1 changed files with 4 additions and 1 deletions
|
@ -137,7 +137,10 @@ def _fetch_option(cfg, ret_config, virtualname, attr_name):
|
|||
if not ret_config:
|
||||
# Using the default configuration key
|
||||
if isinstance(cfg, dict):
|
||||
return c_cfg.get(attr_name, cfg.get(default_cfg_key))
|
||||
if default_cfg_key in cfg:
|
||||
return cfg[default_cfg_key]
|
||||
else:
|
||||
return c_cfg.get(attr_name)
|
||||
else:
|
||||
return c_cfg.get(attr_name, cfg(default_cfg_key))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue