Add missing tests for iscsi_* methods

There was no tests in test_db_api for iscsi_*
methods.

Bug 1187367 found.

blueprint db-api-tests

Change-Id: Ia554e6030307a0c4f0510ab74fe0881ee160f743
Removing service_* options from authtoken

These options are not used in keystoneclient.middleware.auth_token

Change-Id: I62bde18fc7f0b6c336fe941c91cf03f30a490445
Fix config registration in cinder volume drivers.

The config documentation relies on options being registered
on a modules import.  Our need to move the drivers to using
self.configuration for multi-backend support means that options
wouldn't be loaded until object initialization which breaks
documentation.

This patch puts a dummy CONF init/load back in the drivers. While putting
this change together I came across a number of drivers still using FLAGS,
and even worse a number of drivers using a mixture of FLAGS and CONF and
self.configuraiton.  So most of those are cleaned up here as well.

Note there are two drivers that were not updated at all here:
  1. windows.py
  2. zadara.py

The zadara folks have indicated that they're in the process of updating and
releasing a new version of their driver so I left that as is.

The windows driver needs a bit of work to switch over.

Fixes bug: 1179159

Change-Id: I90165299bf080da17741d027e36e361540da0ff8
Unset all stubs before running other cleanups.

Cleanup callbacks are run in reverse order so all stubs unsetting
should be added at the end of the cleanup list.

Fixes bug 1185004

Change-Id: I5ad3ea2cdce663aaeae6b7cc2cb9c5dac9d12435
Merge "Fix config registration in cinder volume drivers."
Remove E12 errors from tox.ini Flake ignores.

This removes the E12 from ignores and fixes up the
existing pep8 errors that we were ignoring.

Change-Id: I5d60f1eed768fcae01a708fcf9ea324844c6376d
Merge "Add missing tests for iscsi_* methods"
Merge "Unset all stubs before running other cleanups."
Replace functions in utils with oslo.fileutils

The following functions have moved to oslo.
ensure_tree
remove_path_on_error
file_open
delete_if_exists

Replaced overlapping functions with the ones in fileutils

Change-Id: Ib10a7ca2c72620f7f1df6c5bd4ef6c9cc4d8e913
Add missing tests for backup_* methods

There was no tests in test_db_api for backup_*
methods.

Add tests to ensure that all works.

blueprint db-api-tests

Change-Id: Ie83de7f9cb3d2c4de5442513a60bfedac312f62e
NFS drivers don't honor vm size with volume from an image

The bug has been encountered with the NFS generic driver
(cinder.volume.nfs.NfsDriver) and the NetApp NFS driver
(cinder.volume.drivers.netapp.nfs.NetAppDirectCmodeNfsDriver). I believe
that drivers based on distributed filesystem such as GlusterFS, nexenta
and scality are also impacted however I didn't test it those backends.
However since most of them already inherit from the RemoteFsDriver
class, this should be fine.

Change-Id: I14575da69a2c99c7cbcece27b40a171153371ee3
Fixes: bug #1183459
Fix 'undefined symbol conn' error

Use self.conn, not conn.

Fixes LP Bug #1188619

Change-Id: Idbd62016fda4cafb6df953ca57af94d56edd3918
Imported Translations from Transifex

Change-Id: I888eb000062b469a4b55274dfec2cfd28e9c329c
Minor Logic bug in NFS Driver.

When checking oversubscription rate, we need to ensure that we
check the _allocated_ (apparant size) not the _available_ (actual
usage) on the NFS share.  This fix ensures we are now checking the
correct values.  This bug allowed (effectively) a one-time
volume allocation that would push the "apparant" size over the
oversubscription rate.

Change-Id: I189b689cb76ac2a243aa6e255ce0c80d86e247ce
Fixes: bug #1188877
Merge "Fix 'undefined symbol conn' error"
Merge "Minor Logic bug in NFS Driver."
Merge "Imported Translations from Transifex"
Add the iscsi device check and exception processing.

Before downloading the image and executing the command "qemu-img convert",
check if the iSCSI device is still available via the command "sudo dd
if=<device> of=/dev/null count=1". This command will raise an exception with
the message "Input/output error", if the back-end storage is disconnected to
the cinder-volume node, so we use it to test the availability of the storage
device. If it is unavailable, there is no need to download the image &
"qemu-img convert" and an exception DeviceUnavailable will be raised.

Fixed Bug1169290.

Change-Id: I133b4cc1bac493df073d42e240092cf2e6300454
Replace FLAGS with cfg.CONF in api

Replace all the FLAGS with cfg.CONF in cinder/api
Large commit was split into several parts

Change-Id: I2114d5fc45f5299c3b2011270034a3370e0ec388
Fixes: bug #1182037
Replace FLAGS with cfg.CONF in tests

Replace all the FLAGS with cfg.CONF in cinder/tests
Large commit was split into several parts

Change-Id: I20a188c20f440e4ba3f5167bd65346ec9fb6e90b
Fixes: bug #1182037