rbd: simplify configuration and use librbd and librados

Add an rbd_ceph_conf options to mirror glance configuration, and use
the existing rbd_user option to choose how to connect to the cluster
instead of relying on an environment variable.  Use these settings
when running command line programs and when connecting via librados.

Use absolute imports so that importing the python librbd bindings
via 'import rbd' does not try to import cinder.drivers.rbd again.

Create some convenience wrappers to simplify librbd and librados
error handling and cleanup. Using these everywhere also simplifies
testing. Mock out all the librados and librbd calls in the tests
so these libraries don't need to be installed.

Remove the local_path() method since it's never used. It was
left over from nova-volume.

There are only three things still relying on the command line:
- importing an image
- exporting to an image
- getting monitor addresses

Importing and exporting on the command line include zero-detection
that would be little benefit to replicate here. librados and librbd
don't have a simple interface to obtain the monitor addresses, so
leave that to a command line tool as well.

Fixes: bug 1083540
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>

Change-Id: I32d059c5e460c2dd8423119b3dbe4a9921f5e907
Add error reporting to generate_sample.sh on import failure.

Currently tools/conf/generate_sample.sh collect options from project
modules by importing each module and looking at it's global variables
for instances of classes derived from cfg.Opt (or lists of such
instances). Sometimes this import can fail due to various reasons,
cfg.DuplicateOptError for example. And if import fails no options
from imported module written to sample config file. Error reporting
will at least warn user that some of options didn't get into sample
config.

Change-Id: I831464b1c1575c106d866a936a50ec74b2d44e59
Fixes: bug #1182611
Fixed method db.api.reservation_expire

There was missing relation in Reservation model.

Change-Id: I6efe558278297aea6d2348b347152c244b3323d6
Fixes: bug 1185325
Fix AttributeError typo

Fixes Bug LP #1186566

Change-Id: I8211d365c4d3532cd6ffc3b3041661ff6b9e637f
python3: Introduce py33 to tox.ini

Introduce py33 to tox.ini to make testing
easier with python3.

Change-Id: I351fa475deffd75201e20e3629af6ed018b9ac7c
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Merge "Add error reporting to generate_sample.sh on import failure."
Merge "Fix AttributeError typo"
Merge "python3: Introduce py33 to tox.ini"
Merge "rbd: simplify configuration and use librbd and librados"
Merge "Fixed method db.api.reservation_expire"