Rename handle_snapshot and pass state

Rename handle_snapshot() to handle_snapshot_delete() to better reflect what
it needs to do (both take a snapshot of the resource and then delete the
resource). Also, pass the state of the resource prior to delete being
invoked, since the resource may want to use different error handling in the
snapshot phase depending on e.g. whether the resource was created
successfully or not.

Change-Id: I1e5aaab4f13e42333c1f2f39bfeb0ebf2ac89ed8
Handle errors in Volume creation

Set the resource_id as soon as it is know, since we need to be able to
delete the volume later, even if it is in an error state. Avoid attempting
to perform a snapshot if the volume was never created successfully.

Change-Id: I33dd842d3d249bafe1037c1b97abf1979f605712
Move Volume polling to check_create_complete()

Rather than poll in a loop inside handle_create(), use
check_create_complete() to check the status of the Volume.

Fixes bug #1178578

Change-Id: Icea7154c6e3763c977bd41671f51736c4a366141
Make Volume snapshot a task

Change-Id: I53fbd6e2ba9b17fa0ccd38d5e077587df0bbfef8
Clean up import of cinderclient exceptions

Don't import a particular version of the cinderclient API - just import the
client module and pass the version we want to the Client() constructor as
is intended. This allows up to access the exceptions directly through
client.exceptions, rather than having to do a separate import.

Change-Id: Ic0e47506a51a572da01fdfdef0367cfdb3e34d54
Cleaned up some simple hacking/pyflakes errors.

There are set of trivial changes that involved missing imports or unused
code. No functional changes should be evident.

Change-Id: If020e33674627845ea78192382bdf8977b442931
Merge "Cleaned up some simple hacking/pyflakes errors."
Merge "Rename handle_snapshot and pass state"
Merge "Handle errors in Volume creation"
Merge "Move Volume polling to check_create_complete()"
Merge "Make Volume snapshot a task"
Merge "Clean up import of cinderclient exceptions"