summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-05-07 22:42:23 +0000
committerGerrit Code Review <review@openstack.org>2015-05-07 22:42:23 +0000
commitdf6c73f1f1b1e703f1526d813759638320ee17e6 (patch)
treecfeb47c06e06b7190f8b2b220c1a9c86106a1653
parentdc8d21db11da1c80ad13f5626bbea63fdd649628 (diff)
parentf6d08765cd8ceb071e99453d3f17faabb5878431 (diff)
downloados-client-config-df6c73f1f1b1e703f1526d813759638320ee17e6.tar.gz
Merge "get_one_cloud should use auth merge"
-rw-r--r--os_client_config/config.py5
-rw-r--r--os_client_config/tests/test_config.py6
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'])