diff options
Diffstat (limited to 'os_client_config')
-rw-r--r-- | os_client_config/config.py | 5 | ||||
-rw-r--r-- | os_client_config/tests/test_config.py | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/os_client_config/config.py b/os_client_config/config.py index f2ddd48..e926555 100644 --- a/os_client_config/config.py +++ b/os_client_config/config.py @@ -363,7 +363,10 @@ class OpenStackConfig(object): # Can't just do update, because None values take over for (key, val) in iter(args.items()): if val is not None: - config[key] = val + if key == 'auth' and config[key] is not None: + config[key] = _auth_update(config[key], val) + else: + config[key] = val for key in BOOL_KEYS: if key in config: diff --git a/os_client_config/tests/test_config.py b/os_client_config/tests/test_config.py index c537842..274b188 100644 --- a/os_client_config/tests/test_config.py +++ b/os_client_config/tests/test_config.py @@ -43,3 +43,9 @@ class TestConfig(base.TestCase): vendor_files=[self.vendor_yaml]) self.assertRaises( exceptions.OpenStackConfigException, c.get_one_cloud, 'envvars') + + def test_get_one_cloud_auth_merge(self): + c = config.OpenStackConfig(config_files=[self.cloud_yaml]) + cc = c.get_one_cloud(cloud='_test_cloud_', auth={'username': 'user'}) + self.assertEqual('user', cc.auth['username']) + self.assertEqual('testpass', cc.auth['password']) |