summaryrefslogtreecommitdiff
path: root/oslo_messaging/tests/test_urls.py
diff options
context:
space:
mode:
authorChangBo Guo(gcb) <eric.guo@easystack.cn>2016-08-03 16:08:57 +0800
committerChangBo Guo(gcb) <eric.guo@easystack.cn>2016-08-14 00:03:05 +0800
commit34122ee3cb08b4de379b8095f4b18d64c38f62e2 (patch)
tree9c8a56787e9a060b600a6fc168dd1d977acd4cb5 /oslo_messaging/tests/test_urls.py
parent4eef58c5d8701d2190675098a1de560164182ffb (diff)
downloadoslo-messaging-34122ee3cb08b4de379b8095f4b18d64c38f62e2.tar.gz
Add warning when credential is not specified for each host
User may not set username/password for each host in config option transport_url. All hosts should have username/password, or no host have username/password at the same time. This commit adds warning if user doesn't set properly. Closes-Bug: #1595965 Change-Id: I4e204ce8365274566064168a2ba02c3278579717
Diffstat (limited to 'oslo_messaging/tests/test_urls.py')
-rw-r--r--oslo_messaging/tests/test_urls.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/oslo_messaging/tests/test_urls.py b/oslo_messaging/tests/test_urls.py
index 176fb75..d722b81 100644
--- a/oslo_messaging/tests/test_urls.py
+++ b/oslo_messaging/tests/test_urls.py
@@ -95,6 +95,14 @@ class TestParseURL(test_utils.BaseTestCase):
username='u', password='p'),
dict(host='host2', port=4321),
]))),
+ ('multi_host_partial_creds',
+ dict(url='foo://u:p@host1,host2/bar', aliases=None,
+ expect=dict(transport='foo',
+ virtual_host='bar',
+ hosts=[
+ dict(host='host1', username='u', password='p'),
+ dict(host='host2'),
+ ]))),
('multi_creds',
dict(url='foo://u1:p1@host1:1234,u2:p2@host2:4321/bar', aliases=None,
expect=dict(transport='foo',