Splitting out volume drivers in driver.py

Moved RBDDriver, SheepdogDriver into their own respective driver
files under cinder/volume/drivers/*. Moved FakeISCSIDriver and
LoggingVolumeDriver into a fake driver file under the tests,
since that's the only place where those are used.

Implements bp driver-cleanup

Change-Id: I39d91ac8e498a9e42c5443db16706203b988444b
Fix 401 from auth_token middleware

The openssl popen call to verify the token returns an error code
of 2 when a file doesn't exist. Normally this is caught and the
relevant file is downloaded, but monkeypatching os causes this
error code to be eaten and cinder to return a 401. Note that this
is likely a race condition that depends on exactly when greenthreads
are switching that is causing the return code from Popen to get
overwritten.

It is possible that this is exposing an underlying bug in eventlet
but the workaround is simply to make sure that we don't monkeypatch
os.

Fixes bug 1075838

Change-Id: I69ba75136e32e95c6fdf108f0c4fe21a5e3bdbe6
Port openstack-common/uuidutils to Cinder

openstack-common has a new uuidutils to handle is_uuid_like(),
port it to Cinder.

Change-Id: I0ccc6166854193137af6a3210d3c465dd38fd955
Changes bit mode of zadara.py to 644

Change-Id: I0b4693d7da4ecfe5242dc302630c40ed2b8268ef
Merge "Port openstack-common/uuidutils to Cinder"
Merge "Splitting out volume drivers in driver.py"
Add admin only action for force detach

This action calls the same methods nova would after it successfully
detaches a volume.  By exposing it to the administrator it makes it's
easier to repair un-syncronized state between services.  Generally when
the host is no longer attached, but the volume state is wrong.

Future work: The Iscsi based drivers don't seem to use
initialize_connection and terminate_connection to create the export for
the volume.  This would be more useful with drivers that do that.

I added the force parameter to terminate_connection for drivers that may
want to differintiate between a normal terminate and the force detach.

Future Nova work:  Nova will want an admin action to update the bdm
tables - today it's a bit of nova-manage shell work.

Change-Id: Icc1cff0f50a5ace9ebdae62c85524ee8d6ec23e0
Fix run_tests.sh ambiguous usage msg and behaviour for -x option

In commit
https://github.com/openstack/cinder/commit/
50792c2ff41fdc7e73b3e3c51f4510366debfd14,
the committer wanted to add an option in run_tests.sh for generating XML
coverage report, but ended up accidentally overriding the default nose
option -x. But, the usage message still showed that using option -x will
'Stop running tests after the first error or failure'. So, I changed the
option to generate XML report to  -X (capitalized 'x'). So now both -x and
-X options are available, with different purposes.

Fixes bug 1070047

Change-Id: Ie8c30c14629d4811d6db74f3eea9cdecb1d27c8a
Add 'create_volume' to scheduler RPC API.

Instead of directly call RPC methods, 'create_volume' should be
implemented in scheduler RPC API in order to do versioning.

This increases scheduler RPC version to 1.1

Change-Id: I22d5a097ec3a73c3460f4acd35c602da57f8b52d
Remove the zeroing out of the volume altogether

Temporary change to get in new version which will
make the secure_delete configurable.

After pushing this and modifying the gate setup we'll
push the flag version.

Change-Id: Ic8a08566e02d822ab0eb309f61993fd8b7d21232
Add ability to disable secure volume delete.

Due to gating issues caused by secure delete on LVM volumes,
add the ability to disable via flag.secure_delete.

Default will be set to True, but we add a way for the gate tests
to disable this until we can come up with a fix for
https://bugs.launchpad.net/cinder/+bug/1023755 OR implement an alternative
secure delete method that doesn' suck.

Change-Id: I2a06e4f0021ba1f5d5aad7d0a5997a992e268858
Remove dm_setup(remove) call in volume_delete.

While it makes sense to perform the dm_setup(remove) before
performing the lvm remove, it seems to cause some buffer IO
errors as evident by kern.log.

I'm also a bit suspicous in that it seems the delete timeouts
we see seems to have increased in frequency with this addition.
I propose this step is removed until we completely understand the
impact of the kernel error on Precise kernels.

Fixes bug: #1075675

Change-Id: I7ae4decea42d8f070d774d3e6376686b3e5b4f83
Merge "Add 'create_volume' to scheduler RPC API."
Scheduler API clean up and refactor

Unlike Nova scheduler, which has to consider serving compute and volume
scheduling, Cinder scheduler only serves volume scheduling, so there's no
need to keep generic interface 'schedule'. Instead, 'schedule_create_volume'
is added (if missing) to manager/driver class and chance/simple scheduler
driver implementation.

Also this patch changes the interface between API service and scheduler to
allow more information about volume is passed to scheduler for advanced
scheduling while maintained backward compatibility. And this change bumps
scheduler RPC API to version 1.2.

Change-Id: I42be05675cd73f89a03c84105ec512d7ee4f3c3a
Merge "Scheduler API clean up and refactor"
Remove unused volume API method - remove_from_compute()

remove_from_compute() method in cinder.volume.api is never used
by others and it is also broken since the interface in Nova has
been changed to remove_volume_connection(), thus it should be
removed from Cinder.

Change-Id: Ibcb2cf7f88606d9a540cc9a03b5c95990fca8c3e
Import order cleanup per HACKING

Change-Id: I5540a5d24f45aa51e0ef58b43427fbaf7726da89
Remove obsolete use_local_volumes

Reading documentation, I felt on that option, but grepping the source
everywhere saw no use at all, and removing seems to be safe.

Change-Id: I0ec22bcc406402420bc06fd28c352b84a4e21b69
Signed-off-by: Julien Danjou <julien@danjou.info>
Merge "Remove unused volume API method - remove_from_compute()"
Merge "Remove obsolete use_local_volumes"