22 Commits

Author SHA1 Message Date
Jenkins
9efdc374e8 Merge "Register opts if we're going to check conf.transport_url in parse()" 2016-12-02 18:52:37 +00:00
Mehdi Abaakouk
9d55749c05 Fix transport url with empty port
When transport url is set to something like "amqp://hostname:/"
it currently raise ValueError while any url parsing library
(like urlparse) just ignore the port, and don't fail since this is a
value url.

This change make the transport url ignore empty port instead of raising
ValueError.

Change-Id: I04df76012e3b133eddbcf365363cd261d277e369
2016-12-02 10:06:30 +00:00
Dan Smith
485986d5ae Register opts if we're going to check conf.transport_url in parse()
In TransportURL.parse(), a classmethod, we expect conf.transport_url
to be accessible if a url is not passed in. However, since the
_transport_opts are not registered yet, that will fail, which is
a pretty easy case to hit if we're constructing our TransportURL
for the first time on startup.

This registers the opts if we're likely to hit it.

Change-Id: Id94bc0a7fec3ce536e134d4f162ac253a775b238
2016-11-28 14:16:39 -08:00
Li-zhigang
ea8fad47a5 Replace six.iteritems() with .items()
1.As mentioned in [1], we should avoid using six.iteritems to achieve iterators.
We can use dict.items instead, as it will return iterators in PY3 as well.
And dict.items/keys will more readable. 2.In py2, the performance about
list should be negligible, see the link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: Ia235afc3532f62f265f91ca46d2306c72fc2a2a2
2016-11-23 09:02:14 +00:00
ChangBo Guo(gcb)
34122ee3cb 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
2016-08-14 00:03:05 +08:00
Gevorg Davoian
282cbc222e Add query paramereters to TransportURL
This patch proposes to allow TransportURLs to have query parameters
with driver-specific options which may override corresponding
values from a static configuration. As an example, the patch
implements this possibility in the pika driver. If the idea is
approved, it will be possible to also implement it in the other
drivers.

Change-Id: Ibb7e13b4509fde035a3c334cde9bc4c498f92140
2016-06-09 16:05:36 +03:00
Jenkins
acb398e317 Merge "Modify the TransportURL's docstrings" 2016-05-26 14:00:19 +00:00
JiaJunsu
5fb8f269e7 Modify the TransportURL's docstrings
To match the test_urls.TestParseURL multi_creds

Change-Id: I4a37b7bce3703aa581bc46d41690bf7978f813a6
Close-Bug: #1529310
2016-05-24 11:37:16 +00:00
Mehdi Abaakouk
4d0f7ab652 deprecate usage of transport aliases
This change starts the deprecation process for the transport aliases.

The first step is deprecate this one cycle. To ensure deployer have
updated they configuration during Newton Then in Octacia we will deprecate
'aliases' kwargs of transportURL() and get_transport() for consuming
application.

Related-bug: #1424728

Change-Id: I314cefa5fb1803fa7e21e3e34300e5ced31bba89
2016-05-23 16:05:57 +00:00
Jenkins
2c24d29fa9 Merge "Make TransportURL.parse aware of transport_url" 2016-05-18 10:08:22 +00:00
Mehdi Abaakouk
6726025630 Make TransportURL.parse aware of transport_url
For no real reason, the transport_url confi option was not read by the
TransportURL class while other config options are read directly from
configuration. Instead the transport_url was always passed to
TransportURL.parse().

This change allows url to be optional for TransportURL.parse() and read
the url from transport_url config when not provided.

Change-Id: Idfe9aa37bf3a409d2c1f76d99ea3d2bdf9837193
2016-05-18 09:28:25 +02:00
Mehdi Abaakouk
2f0d53ba68 rabbit: Deprecates host, port, auth options
We keep backward compatibily of this options since the begin
of oslo.messaging while other driver get theses options trough
the TransportURL.

This changes mark them as deprecated.

Change-Id: I8009c0512f3d7864d2699abf8335bcded259fa02
2016-05-18 09:28:20 +02:00
Jenkins
60a7a893bc Merge "Add parse.unquote to transport_url" 2016-05-14 14:42:44 +00:00
JiaJunsu
2aab5a6370 Add parse.unquote to transport_url
To support special chars in username:password and vhost

Closes-Bug: #1557496

Change-Id: I977bce06c6b1bb71162d49de82a6a3d62df3e6bd
2016-05-07 05:55:12 -07:00
Dmitriy Ukhlov
6db00c77b0 Refactor base interfaces
1) Add MessageHandler base interface for on_incoming_callback replacement
2) Move message_handler parameter form Listener's __init__() to start()
3) Remove wait method from listener

Change-Id: Id414446817e3d2ff67b815074d042a9ce637ec24
2016-04-20 20:46:28 +00:00
Jenkins
55c0b3b52f Merge "Make transport_url config option secret" 2016-04-07 15:05:23 +00:00
Juan Antonio Osorio Robles
cbaf71edfa Make transport_url config option secret
The transport_url may contain credentials to the message queue; For
this reason, this option should be secret for it to not leak into the
logs.

Closes-Bug: #1567233

Change-Id: I49c641a2662976d7220e4222e3c4a4d2586b1336
2016-04-07 05:43:18 +00:00
Dmitriy Ukhlov
5d7d7253d1 Refactor driver's listener interface
Current Listener interface has poll() method which return messages

To use it we need have poller thread which is located in MessageHandlerServer
But my investigations of existing driver's code shows that some implemetations have
its own thread inside for processing connection event loop. This event loop received
messages and store in queue object. And then our poller's thread reads this queue
This situation can be improved. we can remove poller's thread, remove queue object
and just call on_message server's callback from connection eventloop thread

This path provide posibility to do this for one of drivers and leave as is other drivers

Change-Id: I3e3d4369d8fdadcecf079d10af58b1e4f5616047
2016-04-05 18:08:08 +00:00
Flavio Percoco
925eb734a9 Remove qpidd's driver from the tree
Back in liberty we marked this driver as deprecated. This patch removes
it from the tree. The patch also removes tests, options and other
references in the documentation. Note that one script is being kept
because it's required by the amqp driver.

Depends-On: If4b1773334e424d1f4a4e112bd1f10aca62682a9
Change-Id: I4a9cba314c4a2f24307504fa7b5427424268b114
2015-11-20 18:43:28 +00:00
Cyril Roelandt
9e5fb5697d Remove a useless statement
This statement is useless since both 'username' and 'password' are set to None
in the for loop, and that they are not used outside of the loop.

Removing this line also help us getting rid of a false positive thrown by
bandit.

Change-Id: I2aa1a16f30928b77aa40c5a900e35b7bf752658a
2015-10-23 20:07:39 +02:00
Doug Hellmann
ee31a84719 Update Oslo imports to remove namespace package
Change-Id: I4ec9b2a310471e4e07867073e9577731ac34027d
Blueprint: drop-namespace-packages
2015-01-21 21:09:33 -05:00
Doug Hellmann
e55a83e832 Move files out of the namespace package
Move the public API out of oslo.messaging to oslo_messaging. Retain
the ability to import from the old namespace package for backwards
compatibility for this release cycle.

bp/drop-namespace-packages

Co-authored-by: Mehdi Abaakouk <mehdi.abaakouk@enovance.com>
Change-Id: Ia562010c152a214f1c0fed767c82022c7c2c52e7
2015-01-12 12:50:41 -05:00