Fix _get_disk_of_partition edgecase in utils

_get_disk_of_partition in cinder/utils returns a disk device path,
calculated from a supplied partition device path, and stat for a device.

If the disk path calculated by the function, using a regex, is not a
block device the function will return the original device path argument
and the stat object for disk path that was not a block device.

This commit modifies the function so that if the supplied device path is
returned by the function the stat of that path is guaranteed to be
returned.

Change-Id: I7ce0a748fe4a0ebaa02cba11baadb8c71c007aa2
Improve testing of cinder/utils.py

This commit increases code coverage of cinder/utils.py as well as
removing any use of mox and replacing tests that are more functional in
nature with tests more focussed on testing the function in
cinder/utils.py.

Change-Id: I57bb589fa728d715f07aadc4abd0e27670a3a5b6
Inherit RequestContext from oslo

In the long-term, OpenStack projects should use oslo.context as the base
class for their custom contexts. This enables the use of
application-agnostic tools, e.g. global logging configurations. See
http://specs.openstack.org/openstack/oslo-specs/specs/juno/app-agnostic-logging-parameters.html

This patch syncs the latest context module from oslo-incubator and use
it as the base class for Cinder RequestContext. The goal is to clean up
Cinder code, and to be ready for the first oslo.context release.

Change-Id: Iba9354b402de556ca6e55e7c17dd6f3f1624d72d
Related-bug: #1210261
NetApp fix vol migration unusability

This patch fixes the volume migration related issue
in which the volume became unusable after successfull inbound
migration due to volume id usage instead of name_id.

Closes-bug: #1370098

Change-Id: Iacb14ea07890859b5cf8a27c150aa5f6e8a98777
Fix 3PAR driver attach error when host name missing

In some cases an error was being thrown by the 3PAR driver
when the 'name' property returned from queryHost was
missing.  This change adds a check so that the driver
reacts properly when this occurs.  Also removed an unneeded
warning output that was still in the FC driver.

This patch is related to this merged bug fix:
https://review.openstack.org/#/c/138212/

Closes-Bug: 1398206
Change-Id: I6593dc68616f55496c42d625968adfc684f98032
Use pbr entry_points to setup the cinder scripts

The following patch changes how cinder scripts are
installed and unit tested. This patch moves all the
cinder scripts from bin into cinder/cmd and creates
entry_points for those scripts in setup.cfg. When
cinder is installed, these scripts will be installed
under /usr/local/bin by pbr.

DocImpact: 'host' config option for multiple-storage backends
in cinder.conf is renamed to 'backend_host' in order to avoid
a naming conflict with the 'host' to locate redis
Change-Id: If82cf0c58d765bf79dbf721ca95c10a468940cab
Implements: blueprint unit-test-cases-for-cinder-scripts
Updated from global requirements

Change-Id: I305473aa6a64ea685a7e23aace3c91df983e8fb5
Fixes intermittent NFS driver mount failure

During cinder volume driver initialization, NFS drivers often
fail to mount the NFS share backing their volumes, complaining
that the share in question is 'busy or already mounted'.

This commit introduces a retry loop around the ensure_mounted()
call inside set_nas_security_options() so that if there is contention
between volume process and backup process mounting the same share
the driver will not be stopped from loading.

Change-Id: I672433c1c31f420e5dcdbe565db3bb29af3abe7b
Closes-bug: 1395823
Merge "Fix 3PAR driver attach error when host name missing"
Merge "NetApp fix vol migration unusability"
Merge "Inherit RequestContext from oslo"
Merge "Fixes intermittent NFS driver mount failure"
Merge "Updated from global requirements"
Implementing the use of _L’x’/i18n markers

Placing the _Lx markers back into the code. No other cleaner solution has
has been implemented. Patches will be submitted in a series of sub
directories and in a fashion that is manageable.
eighth commit of this kind
This is the last run through to pick up the ones that were missed

Change-Id: Ifd9d647175a840939bf01fa3bcecfa6384965e3b
Closes-Bug: #1384312
Merge "Fix _get_disk_of_partition edgecase in utils"
Merge "Improve testing of cinder/utils.py"
Merge "Use pbr entry_points to setup the cinder scripts"