2014-08-12 09:31:06 |
RedBaron |
description |
The documentation for the classmethod `parse` states that
The last parsed username and password will be propagated to the rest
of hosts specified::
user:pass@host1:port1,host2:port2
[
{"username": "user", "password": "pass", "host": "host1:port1"},
{"username": "user", "password": "pass", "host": "host2:port2"}
]
However, in parctice one needs to specify the usernames and passwords individually with every host. Otherwise no authentication credentials are set for that host. The test cases in the test_url.py file are also written keeping that behaviour in mind.
>>> TransportURL.parse(oslo.config.cfg.ConfigOpts(),"rabbit://admin:pass@127.0.0.1:5672,127.0.0.2:5672//")
<TransportURL transport='rabbit', virtual_host='/', hosts=[<TransportHost hostname='127.0.0.1', port=5672, username='admin', password='pass'>, <TransportHost hostname='127.0.0.2', port=5672>]>
>>> TransportURL.parse(oslo.config.cfg.ConfigOpts(),"rabbit://admin:pass@127.0.0.1:5672,admin:pass@127.0.0.2:5672//")
<TransportURL transport='rabbit', virtual_host='/', hosts=[<TransportHost hostname='127.0.0.1', port=5672, username='admin', password='pass'>, <TransportHost hostname='127.0.0.2', port=5672, username='admin', password='pass'>]>
One out of code+tests or documentation needs to be changed. |
The documentation for the classmethod `parse` states that
The last parsed username and password will be propagated to the rest
of hosts specified::
user:pass@host1:port1,host2:port2
[
{"username": "user", "password": "pass", "host": "host1:port1"},
{"username": "user", "password": "pass", "host": "host2:port2"}
]
However, in practice one needs to specify the usernames and passwords individually with every host. Otherwise no authentication credentials are set for that host. The test cases in the test_url.py file are also written keeping that behaviour in mind.
>>> TransportURL.parse(oslo.config.cfg.ConfigOpts(),"rabbit://admin:pass@127.0.0.1:5672,127.0.0.2:5672//")
<TransportURL transport='rabbit', virtual_host='/', hosts=[<TransportHost hostname='127.0.0.1', port=5672, username='admin', password='pass'>, <TransportHost hostname='127.0.0.2', port=5672>]>
>>> TransportURL.parse(oslo.config.cfg.ConfigOpts(),"rabbit://admin:pass@127.0.0.1:5672,admin:pass@127.0.0.2:5672//")
<TransportURL transport='rabbit', virtual_host='/', hosts=[<TransportHost hostname='127.0.0.1', port=5672, username='admin', password='pass'>, <TransportHost hostname='127.0.0.2', port=5672, username='admin', password='pass'>]>
One out of code+tests or documentation needs to be changed. |
|