Use mock's call assert methods over call_args_list

The way we're checking the value of call_args_list on a mock method is
essentially what assert_called_once_with() since we also know the
method is only called once. In other cases, we can use
assert_has_calls().

I'm slightly nervous of using call_args_list because it's the kind of
thing you could imagine changing in future, even though it's not
marked private.

Change-Id: I7eb3d095f7a1ff9a4abc9e027193d4918d0cda6c
Ensure routing key is specified in the address for a direct producer

This then matches the address used a direct consumer.

Change-Id: If71f78e50f8a9b3acfd1e9d02c8271f17c4ebee7
Closes-Bug: #1300318
Remove rendundant parentheses of cfg help strings

There is a hacking review https://review.openstack.org/#/c/74493/.
That makes me be aware we maybe have rendunant parentheses.
We'd better clean the parentheses, Python will handle that well.

Change-Id: Ib29f995feed45d71000f333a2cc7d14b0efcb0d5
Select AMQP message broker at random

The rule of choosing AMQP message broker is that chose first
available one in order now. The order depends on what we set in
configuration file. That means all the connections will flock
to same message broker and that may lead out performance issue.
This patch randomizes the order of choosing message broker for
each connection to leverage broker cluster.

Change-Id: Ib5098e574d4ef81428065885e2295d0f87aba715
Partial-Bug: #1261631
Logical error in blockless fanout of zmq

The blockless fanout doesn't take effect and it
only processes the FIRST one by returning after the first loop.

Change-Id: Iad071ab455e36be7b26637b286ca9f83fea4a019
Closes-Bug: #1300539
Merge "Remove rendundant parentheses of cfg help strings"
Merge "Ensure routing key is specified in the address for a direct producer"
Merge "Use mock's call assert methods over call_args_list"
Merge "Logical error in blockless fanout of zmq"
Full support of multiple hosts in transport url

This patch add the support of multiple hosts in transport url for rabbit and
qpid drivers. And also fix the amqp connection pool management to allow
to have one pool by transport.

Implements blueprint multiple-hosts-support-in-url

Co-Authored-By: Ala Rezmerita <ala.rezmerita@cloudwatt.com>
Change-Id: I5aff24d292b67a7b65e33e7083e245efbbe82024
Fix typo in docstring of notify/notifier

Change-Id: Idd9f60e4d7ba65157f82f2a4c128f63c3ad6e805
Updated from global requirements

Change-Id: Iccddbe52b2550f81189f23c9f5624def817681ad
Enable log messages to handle exceptions containing unicode

Currently the format string is a normal string, which in
py2x is not unicode.  When the unicode exception information is
used to replace the %s, str() is called on it, but because
it is unicode str() fails.  Making the format string unicode
fixes this.  For the error log this is done by making it
translatable and for the debug message by explicity making
it unicode.

The exception will contain unicode when the exception being
returned by the other project is either translated to a
language using unicode characters or when lazy translation
is enabled and a gettextutils.Message instance is returned.

Change-Id: I1706f5eb9dfbee434f8882b03dad4674d955c370
Closes-Bug: #1310397
Remove dependent module py3kcompat

Module py3kcompat was removed from oslo-incubator, we can use
six directly.

Syncing module network_utils:
162e850 Remove import workaround of SplitResult
897aa7c urlsplit issues with IPv6 addresses in python26
35dc1d7 py3kcompat: remove

Change-Id: I71446362209c306c7e8858f4713a59b84fbcc1b2
Closes-Bug: #1280033
Merge "Updated from global requirements"
Remove str() from LOG.* and exceptions

gettextutils is expecting to receive unicode strings
rather than basestrings. A basestring can cause an
unhandled exception in the logging code. To help avoid
such issues we should remove str() from LOG.* messages and
exceptions. We have verified that the %s formatting code
properly handle getting strings to unicode where necessary.

Copied from https://review.openstack.org/#/c/77722

Change-Id: I082af5c9ae8bf9859382c2c387b10b48358e10b3
Related-Bug: #1286306
Synced jsonutils from oslo-incubator

The sync includes change that drastically enhances performance on Python
2.6 with fresh simplejson library installed.

The latest commit in oslo-incubator:
- 732bdb6297eb9de81667f7713ebcb1ccc2ee45a7

Change-Id: Ib3dc0b713ed90396919feba018772243b3b9c90f
Closes-Bug: 1314129
Merge "Synced jsonutils from oslo-incubator"
Updated from global requirements

Change-Id: Ie783701512f121acf9360ea8025e9996c67f41fb
Fix passing envelope variable as timeout

The envelope variable is being passed positionally in the timeout spot.

Change-Id: I64defdb0a9544d8c2ae69b38f723937b324ae504