diff options
author | Dean Troyer <dtroyer@gmail.com> | 2016-08-02 21:15:49 -0500 |
---|---|---|
committer | Dean Troyer <dtroyer@gmail.com> | 2016-08-02 21:15:53 -0500 |
commit | 05b3c933b34e9cec9eb859a15392862918b3eb5f (patch) | |
tree | f524001a4973c71506303f2e257a60b22e3b9eda | |
parent | 51b4cbee522e2bf1a2beb12425733435ff1c32d9 (diff) | |
download | os-client-config-05b3c933b34e9cec9eb859a15392862918b3eb5f.tar.gz |
Fix precedence for pass-in options
The passed-in argparse Namespace is flat and does not have an 'auth'
dict, all of the auth options are in the top level. If the loaded
dict from clouds.yaml as an 'auth' dict, that used to totally override
any passed-in options.
This is backwards.
Make the passed-in auth options always win over clouds.yaml as this is
the only way to change/override those values from the command line.
Change-Id: Ic2752a396d45deeda19a16389437679829e0844d
-rw-r--r-- | os_client_config/config.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/os_client_config/config.py b/os_client_config/config.py index f1df797..0f19dd1 100644 --- a/os_client_config/config.py +++ b/os_client_config/config.py @@ -885,14 +885,14 @@ class OpenStackConfig(object): plugin_options = loader.get_options() for p_opt in plugin_options: - # if it's in config.auth, win, kill it from config dict - # if it's in config and not in config.auth, move it + # if it's in config, win, move it and kill it from config dict + # if it's in config.auth but not in config we're good # deprecated loses to current # provided beats default, deprecated or not - winning_value = self._find_winning_auth_value( - p_opt, config['auth']) + winning_value = self._find_winning_auth_value(p_opt, config) if not winning_value: - winning_value = self._find_winning_auth_value(p_opt, config) + winning_value = self._find_winning_auth_value( + p_opt, config['auth']) # Clean up after ourselves for opt in [p_opt.name] + [o.name for o in p_opt.deprecated]: |