Make RPCVersionCapError extend base exception

Change-Id: I4e3d773e41c43ea542a4a3c0136b7483a8b0384b
Apply version cap check when casting

We were only applying it when calling.

Change-Id: I70176a8fb9f59ae46108eccd6b54817fbab559d1
Add lockutils.check_for_lock()

Add a function that can be passed to messaging.RPCClient as a lock
check callback so that oslo.messaging doesn't depend on eventlet's
corolocal.

A debug_check_for_lock() variant is available which only applies this
check when debugging is enabled.

Change-Id: Id9013ac2d05e8dd29ebe61b60cbb313deeb05f16
Make RPCClient.check_for_lock a callable

We really don't want to depend on openstack.common.local since it
implies a dependency on eventlet.corolocal.

Instead, make the check_for_lock parameter a callable which is given the
ConfigOpts object and returns a list of held locks. To hook it up to
lockutils, just do:

  client = messaging.RPCClient(transport, target,
                               check_for_lock=lockutils.check_for_lock)

Although you probably want to use lockutils.debug_check_for_lock() which
only does the check if debugging is enabled.

Change-Id: Ic07ccdb92e3137c873f0ef791ba25625aa5803f1
More client unit tests

Change-Id: Ie22cfa1f77200ee99f23c5c15dcc22e95f0ccb84