Explicitly name subscription queue

This ensures that on reconnect the same queue is used rather than leaving it abandoned
but still bound with the same routing key that will be used with the new queue.

Change-Id: Ib76371a3b649688df395d7bf07f813a837b2313a
Closes-Bug: 1318742
Fix MemoryBackend not purging item from _keys_expired on delete

The memory backend for openstack.common.cache uses a dictionary,
"_keys_expired", to track the TTL for individual cache entries.
Keys with the same expiration time are grouped into a set. The
values for each key are stored in a separate dict, "_cache".

When a cache entry is to be deleted, it must be removed from
both "_cache" and "_keys_expired". In the latter case, the
code was attempting to remove the cache entry's *value* from
the key set, rather than the *key* itself.

This patch fixes the bug and introduces a white-box regression
test. A black-box test would not be able to check whether
_keys_expired actually deleted the correct key.

Change-Id: I5ad156e5709b1ce138dcdc4f3ff1dda17c478cab
cfgfilter: fix typo in register_cli_opts()

Obviously, we should be calling register_cli_opt() here but we had no
test coverage to catch it.

Change-Id: If0972486824504d915a022740ed875f5a7e8b007
cfgfilter: switch to assertEqual(expected, actual)

Apparently, we're all agreed now that this is the argument order for
the testtools implementation of assertEqual().

Change-Id: Ie1a5e8099886e45d983cc164b862815bb2e77292
cfgfilter: use some testtools helpers

We can use assertIsNone(), assertIn() and assertNotIn() in place of
assertTrue().

Change-Id: If7147629ba2dfc1f381d94482029c793f020f37f
cfgfilter: fixup use of testmods

Only one test should ever use each testmod, since they register their
options with a global object and the options are never deregistered.

The testmods with prefix 'f' were added for 'filter' tests, but it
looks like things got a bit screwed up. Keep the 'f' prefixed testmods
for the cfgfilter tests and the other testmods for the config file
generator tests.

Change-Id: Ia7a44a36f5a046fdb4c2f58105229657b0e7e92f
cfgfilter: finally make this thing useful!

cfgfilter was initially conceived to help enforce the usage of
import_opt() within Nova - that a module which uses ConfigFilter
will be prevented from using any config option unless it was
registered or imported by that module.

It turns out the more interesting that is very closely related wasn't
addressed - that any options registered by a module which uses
ConfigFilter should not be visible outside of that module.

The latter use case is hugely important for libraries like
oslo.messaging. Here we are registering options (e.g. 'rpc_backend')
inside the library in such a way that users of the library can
access those config options. Yet it is highly likely that these
options will be renamed in the future, thereby breaking code which
accesses these options (but not breaking config files which uses
these options).

The way this new ConfigFilter implementation works is to recognize
there are two parts to a ConfigOpts instance - the set of option
schemas registered with it and raw config values parsed from config
files and the command line. If we simply ensure that ConfigOpts has
its own set of option schemas but yet shares the parsed values with
the underlying ConfigOpts, we allow ConfigFilter to act as a distinct
view of the underlying parsed values.

Note: this implementation is using private implementation details
of the oslo.config library and, as such, it really needs to be
included in oslo.config before anyone starts using it. To make sure
no-one misses this point, I'ved added a subtle warning you must
acknowledge before using the API.

Change-Id: Idefdf024776851a37a23590373d770cf7e512b94
cfgfilter: fix some docstring issues

Change-Id: Ibc7fe1e9815b2f0f7788bbb96ccc8fcaf54d7a0f
Make policy debug logging less verbose

Nova recently synced in the latest policy code, and the api logs are now
filled with "Rule %s will now be enforced." In the nova context this log
isn't very useful and gets triggered multiple times per API call, as a
single API call can consist of multiple extensions.

Change-Id: I085d8fe12e92401d294ace8cc58da425e46deda2
Fix issue of duplicate creation for connections in impl_qpid

Within __init__ of Class Connection, self.connection_create and
reconnect() will both construct a new connection object. Need to fix
it.

Change-Id: I6e3183d36d11995970fb8dce45240f804ec52ab4
Closes-Bug: #1330364
Add a RequestContext.from_dict method

This adds a new methods allowing the creation of a RequestContext from a
dict, useful when passing it serialized.

Change-Id: Id66aba0c600896521a4a236e0a97859735419357
Updated from global requirements

Change-Id: Iffc47de7b99ec9c6d587cbb3e79b29961c4e71c1
Merge "Fix MemoryBackend not purging item from _keys_expired on delete"
Merge "cfgfilter: fix typo in register_cli_opts()"
Merge "cfgfilter: switch to assertEqual(expected, actual)"
Merge "cfgfilter: use some testtools helpers"
Merge "cfgfilter: fixup use of testmods"
Merge "cfgfilter: finally make this thing useful!"
Merge "Make policy debug logging less verbose"
Merge "Add a RequestContext.from_dict method"