Fix broken --version command

The code for lazy loading of version string was broken. The way it
breaks in glance and oslo is different. This patch is just for oslo.
Here we end up overriding more methods in our lazy string class to make
argparse happy and added test cases to make sure we don't break again.
we also sure we cache the result of the lookup so we return the same
version everytime and for performance. Added a few test cases as well.

Fixes LP #1085984

Change-Id: I0635899c37fa8e5a7edf282907d2a5e04aa064cb
Fix qpid cast_to_server regression.

This patches addresses a regression in the qpid driver for the
cast_to_server and fanout_cast_to_server methods.  The regression was
introduced in 86952852c1dadd54f1294ae0adba01cfe827b8ce.

There are test cases that cover this code, but unfortunately they are
not being run by jenkins because python-qpid is not available in pypi.

Fix bug 1086848.

Change-Id: I89d4f81149f9a05c578b5ec544c5e34311484c6c
Merge "Fix broken --version command"
Fixing the trim for ListOp when reading from config file

Fixes Bug 1087018

Change-Id: I1c2d34166ae85add86daab6a7483b63297d00f66
Merge "Fix qpid cast_to_server regression."
Change Exception MissingArgs's string

The error message in MissingArgs shows python names not the arg name the
user will use in the CLI (see for example 'nova-manage flavor create')

Change-Id: I544cede6ec60c8cde2438d1b378191271cec1aec
Allow nova and others to override some logging defaults

- In log.py, indicate that logging module allows tweaking
of just logging_context_format_string option
- In cfg.py, add a method that can alter the default given
the options and new default
- add testcases for log.set_defaults and cfg.set_defaults

Fixes LP #1083218

Change-Id: Iefdbce8505eb7a07f2b59d4ed7564b0146f1b0cd
Merge "Fixing the trim for ListOp when reading from config file"
Add deprecated --logfile common opt.

This adds a deprecated common options for --logfile which
is an alias for --log_file. This resolves some backwards compatability
issues with the most recent oslo common code where --logfile
was no longer a valid opt.

Change-Id: I17b1277da94a2d81ae439d650a6d7321420dfe14
Allow exceptions to pass over RPC silently

When one service performs an operation on behalf of another, the
act of passing back an exception (even a known one) causes a lot
of scary log messages about the (presumed to be) error case. This
patch adds a client_exceptions decorator common/rpc/common.py,
which allows RPC services to declare the list of expected exceptions
for each method. If such an exception is raised during the RPC
dispatch, it is wrapped in a ClientException so that the RPC layer
can gracefully pass it back without overly-verbose logging.

This will allow us to fix nova bug 1084707

Change-Id: I4e7b19dc730342091fd70a717065741d56da4555
Merge "Allow exceptions to pass over RPC silently"
Merge "Allow nova and others to override some logging defaults"
Merge "Change Exception MissingArgs's string"
Merge "Add deprecated --logfile common opt."
Add a rpc wire format version number.

This patch adds a message envelope that includes a wire format version
number.  This message envelope will allow us to embed additional
metadata later on, such as a signature for the message payload.

Up to this point, we've deferred message serialization as a
responsibility of the messaging library we're using by passing it a
message as Python types and letting it deal with how to pass it over a
network.  This patch adds json serialization in the rpc layer of the
application message payload before passing the message down into the
messaging library.

There are some benefits to be gained by doing a pass at serialization
ourselves.  As an example, we occasionally hit serialization bugs that
only affect some messaging drivers.  The kombu driver has always had a
nice advantage.  It uses anyjson internally for serializing messages,
which we hook into using our jsonutils module.  When there is a problem
serializing, we automatically use to_primitive() to fix it.  This patch
allows all drivers to take advantage of this automatic message fix-up.

This also creates a convenient common hook point for messages coming in
and out of the system, regardless of the driver in use.

Implement blueprint version-rpc-messages.

Change-Id: Ib6b2d11ca42abaa64c40986d72233e7048e504a0