zmq: switch back to not using message envelopes

In oslo-incubator, we default to not serializing messages using a
message envelope:

  def _cast(.., envelope=False, ...)

except using the v2 notifyer which explicitly passes envelope=True.

However, in oslo.messaging, we accidentally switched to using a
message envelope:

     def _send(self, ..., envelope=True):

This was not intentional and may be disruptive to users.

This issue was identified because the envelope=True path just doesn't
work! We don't have any zmq tests in oslo.messaging, but even in
oslo-incubator the code path isn't tested and has been broken since
I73aad7697cf83ad4aabb3c2058b7cc4f53f783c2

Partial-Bug: #1301132
Change-Id: I6aa2e2ac3cebf443719d64ebcd9eaadc0a9328b8
Use a for loop to set the defaults for __call__ params

Instead of setting the default kwargs based on a repeated
setdefault() call, just use a for loop to set the defaults.

Change-Id: I5c7fd22856912545bf5f95fd07568375dbecbe5b
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
Merge "Enable log messages to handle exceptions containing unicode"
Merge "Use a for loop to set the defaults for __call__ params"
Explicitly name subscription queue for responses

This prevents response queues being abandoned but still bound to
the exchange with the same key as the newer queue.

Change-Id: Iee0465010a1c6d00e96fb672505688a0f763f86c
Closes-Bug: 1318742
debug level logs should not be translated

According to the OpenStack translation policy available at
https://wiki.openstack.org/wiki/LoggingStandards debug messages
should not be translated. Like mentioned in several changes in
Nova by garyk this is to help prioritize log translation.

Change-Id: I4af4a45a56b1364a2f5196b75cff299d607ab393
Partial-Bug: #1317950
Make the TransportUrl hashable

The amqp connection pool uses the Transport Url as key
to track the connection, but currently a different hash can be
returned for the same url.

This change fixes the hash method of the TransportUrl

Change-Id: Id701d6a80a909d6bd6dabe680c2b8e09dd721ef1
Closes-bug: #1316891
Cleaned up references to executor specific RPCServer types

In oslo.messaging design phase, it was planned to introduce executor
specific RPCServer types though they were never implemented. References
to those types sneaked into docstrings from the original design
document. Since we're not going to implement those types now, docstrings
should be updated accordingly.

Change-Id: Ic4017bb8f89d47115bb7dc59483e81d26c76212b
remove default=None for config options

In the cfg module default=None is set as the default value.

Change-Id: I5de0c1ddeeaccde8183ec130c85524f5b57f6f74
Closes-Bug: #1323975
Remove amqp default exchange hack

This change remove the hack to set the default exchange of a transport in the
amqp driver, by removing the usage of the configuration object to get the
default exchange in rabbit and qpid driver, and instead use the value
passed to the driver constructor into all amqp publishers and consumers
class/method that needs it.

Closes-bug: #1256345
Change-Id: Iba54ca79a49f8545854205c1451b2403735c1006
Updated from global requirements

Change-Id: I6a2fe617cab3370b13de3e45f52076e53d260724
Setup for translation

To start translation, we need to initially import the
translation file - and place it at the proper place so that
the usual CI scripts can handle it.

The proper place is for all python projects
$PROJECT/locale/$PROJECT.pot - see setup.cfg.

Further imports will be done by the OpenStack Proposal bot.

Setup also setup.cfg with the usual babel commands and add the default
babel.cfg file.

Change-Id: I583e98fac2f9b84cd1115640b936057ad95957e8
fixed pep8 issue E265

  * E265 block comment should start with '# '

E265 was introduced in pep8 1.5 (2014-03-26).

Change-Id: I076addadd2e67a8ac4162c706a36239f4af37a8c
Merge "Remove amqp default exchange hack"
Removes unused config option

This change removes the unused 'allowed_rpc_exception_modules' options

Change-Id: Ibb30709e5a3a08573fc1975fab80498a27b5ef0f
Merge "Setup for translation"
Bump hacking to 0.9.x series

In order to keep this patch to just a requirements bump, ignore new and
stricter hacking rules that are being triggered. Fixing up the code and
turning these on is out of scope of this patch and is for future patches.

Change-Id: I5711e066da1076486d291bc4f45359ecb26e1b1a
Merge "Removes unused config option"
Add an optional timeout parameter to Listener.poll

For asynchronous programming, a timeout parameter is required on the listener
to allow to stop it at exit. poll() returns None on timeout.

It plan to use it in my new asyncio (Trollius) executor:
https://review.openstack.org/#/c/70983/

See also the related blueprint for the rationale:
https://wiki.openstack.org/wiki/Oslo/blueprints/asyncio

Change-Id: I918ae3c267743a0eaed1d6a210c79fb4a0eb8733