Fix "DirectConsumer needs mirrored queue support"

Currently TopicCosumer and FanoutConsumer can be used
Mirrored Queue support, but not DirectConsumer.
This patch fix this issue.

Fix bug 1124162

Change-Id: I68ae23467ae810ce0ec917a4cb34a488283f401c
Add function for listing native threads to eventlet backdoor

The eventlet backdoor has a 'pgt' function for listing green
threads and their stack traces. This adds a new 'pnt' function
for doing the same with native threads.

Change-Id: If6dcfd8dde61c96adfc6e052e5ec7db82914cd55
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add ConfigFilter wrapper class

Implements blueprint cfg-filter-view

At the moment, if a module requires a configuration option from another
module, we do:

  CONF.import_opt('source.module', 'option_name')

but, in fact, all options from the imported module are available for
use.

The new ConfigFilter class makes it possible to enforce which options
are available within a module e.g. with

  CONF = cfgfilter.ConfigFilter(cfg.CONF)
  CONF.import_opt('foo', 'source.module')
  CONF.register_opt(StrOpt('bar'))

then the foo and bar options would be the only options available via
this CONF object while still being available via the global cfg.CONF
object.

Change-Id: Ie3aa2cd090a626da8afd27ecb78853cbf279bc8b
Merge "Add ConfigFilter wrapper class"
Implement replay detection.

Bumps the envelope revision to 2.1

Change-Id: Ib0260a0c62e3d312d2e3448a125bed64d861319e
Support RPC envelopes in impl_zmq

This patch began as a set
of tests verifying the functionality of
sending and receiving RPC envelopes when
using impl_zmq. It was discovered that
when enabled, RPC envelopes were not
actually working,

The ZeroMQ driver includes its own envelopes.
This patch introduce versioning to that
envelope, eliminating the previously reserved
'style' field.

A new iteration of the zeromq-envelope is
introduced, 'impl_zmq_v2'. It specifies
that the zeromq-envelope should be followed
by an unpacked array representing key value
pairs of the standard RPC Envelope.

Because the key-values of the RPC Envelope
can be successfully transformed with bytes(),
this prevents the need to double-serialize
the content traversing the message bus.

Also removes some unused imports.

Closes bug 1123709
Closes bug 1055446

Change-Id: Ib04e3d092c9596146f1048d3502ac248496d313b
Fast serialization of RPC envelopes for Kombu

By flattening the dictionary and turning
it into a fast-serialized string, we save
ourselves from Kombu's very slow JSON serialization
routines.

Change-Id: I64796265c7cc89a05406faabd8d7b253fe3b8acb
Merge "Add function for listing native threads to eventlet backdoor"
Avoid using cfg in install_venv_common

Several people have complained that requiring oslo-config to be
installed in order to run install_venv seems like a chicken and egg
problem.

We're only using cfg for a boolean CLI option which is way overkill.
The truth is that cfg is really only interesting if you want to process
options from both the command line and configuration files. Clearly
that's not the case here.

Just use argparse instead of cfg.

Change-Id: Ib602686b554c3548f4be3d4a69d128c5fef7e8cf
Merge "Avoid using cfg in install_venv_common"
Merge "Implement replay detection."
Merge "Fast serialization of RPC envelopes for Kombu"
Merge "Fix "DirectConsumer needs mirrored queue support""
Fix IPC direct topic routing.

Direct messages were being stripped of the host
value when performing IPC forwarding. This caused
direct topics to be round-robined to all
services running on the system consuming from
the same base topic name.

i.e. if 'scheduler.host1' and 'scheduler.host2'
were running on the SAME machine, messages to
'scheduler.host1' may have been routed to
'scheduler.host2'.

Now, mulitple processing specifying different
rpc_zmq_host parameters will consume on
separate direct topics and will not
round-robin to other processes.

Adds a zmq-specific test to ensure that messages to
directed topics are not consumed by other
consumers of direct topics sharing a bare
topic on the same host.

Fixes bug 1123715

Change-Id: I939c24397e58492fc16561666aed3ca891325e9c
Setup exception handler after configuring logging.

We currently set up the exc handler before we configure logging.
This means that an error in the setup will try to raise an exception
which will then fail to log properly because we haven't set up
handlers properly yet. Therefore, simply rely on the default
exception handler during setup and setup our exception handler
immediately after logging is configured.

Fixes bug 1130464

Change-Id: I4b80c646a7d7d5048c8fbadc67dbb9f607d2af69
Merge "Fix IPC direct topic routing."