Use cfg's new global CONF object

Cherry picks 00786bc from Nova.

Implements blueprint cfg-global-object

Replace cinder.flags.FLAGS with openstack.common.cfg.CONF.

In future, we can do a s/FLAGS/CONF/ across the codebase.

Change-Id: If213a4a5da1faf96aac82f34b18d1e0b061495c0
Sync cfg and iniparser from openstack-common.

Cherry picks af387b9, cb6bf34 and c6c29ab from Nova.

This change pulls in the latest version of the cfg module from
openstack-common includes some formatting changes, spelling fixes,
support for bol/eol spaces in values and support for deprecated
options.

Change-Id: I58c7b2100b594f5f261c089d674f449a1a7d067b
Add version to scheduler rpc API.

Part of blueprint versioned-rpc-apis.

One side effect of this change was that cinder.scheduler.api was removed
in favor of cinder.scheduler.rpcapi.  In this case, the api was just a
direct wrapper around rpc usage.  For other APIs, I've been following
the pattern that the rpcapi module provides the rpc client wrapper, and
if any other client-side logic is needed, that's where an api module is
used.

Change-Id: Ibd0292936f9afc77aeb5d040660bfa857861eed1
Localize rpc options to rpc code.

Part of blueprint common-rpc.

Move rpc options from cinder.flags into cinder.rpc code.  This is necessary
before the rpc code can be moved to openstack-common.

Change-Id: I474c3660e1cbd3ab663571b1e088c84deb905e0b
Remove cinder.context dependency from cinder.rpc

Part of blueprint common-rpc.

This patch removes the usage of cinder.context from cinder.rpc.  Everything
needed to implement RpcContext now exists within cinder.rpc.

Change-Id: I9e6ec0d22e55d3d4f38e12e0fdd2df745da496f5
Remove cinder.log usage from cinder.rpc.

Part of blueprint common-rpc.

This patch removes the usage of cinder.log from cinder.rpc.  This is
necessary before cinder.rpc can be moved to openstack-common.  The rpc
logging was not using any of the extra features provided in cinder.log as
far as I can tell, so the changes are very simple.

This is the final dependency.  After this change, the rpc code
can be moved to openstack-common without any changes.

Change-Id: I17ca4b691bb8d4f18e618632a2381dd12d31852a
Use openstack.common.cfg.CONF.

Part of blueprint common-rpc.

This patch makes the rpc code use the global config object from
openstack-common.  Based on some recent discussions on the mailing list,
this may not be the final way configuration handling is done here, but
it is certainly better than the register_opts() hack that is removed by
this patch.

Change-Id: Id128126e0bc064a2a1c710c6bd32fb3d137dc7f6
Use save_and_reraise_exception() from common.

This patch common.excutils from openstack-common, which includes
save_and_reraise_exception().  The patch also converts the code
base to use it from there instead of cinder.utils and then removes
it from cinder.utils.

The initial motivation for this was removing another cinder dependency
from cinder.rpc so that it can eventually be moved to openstack-common.

Change-Id: I7354ca51a02aec9c709cf33f77d4abc46acc2742
Add missing gettextutils from openstack-common.

This patch adds gettextutils from openstack-common to cinder.  It is used
by rpc, so some parts of rpc are broken without this patch.

Change-Id: I0830319f4e2011b87180abcc24354c935bea8d16
Use rpc from openstack-common.

Final patch for blueprint common-rpc.

This patch removes cinder.rpc in favor of the copy in openstack-common.

Change-Id: I9c2f6bdbe8cd0c44417f75284131dbf3c126d1dd