VMware: Fix unhandled session failure issues

VMware driver has a re-try mechanism to handle session expiration
failures. Due to a minor bug in the exception handling module, this
failure was unhandled.

The patch fixes this issue and has added tests.

Closes-Bug: #1252827
Change-Id: Ie91adb4b4b57b7cefeed855cdbe4710da86294f0
Clean up test cases for compute.manager._check_instance_build_time

This patch cleans up the unit tests related to the
_check_instance_build_time method so that they are actually verifying
the expected vm_state value when the instance is updated.

This patch also removes the test_instance_build_timeout test case
since it was completely redundant with the other one modified
here. I checked the git history and both test cases were added
in the same commit which confirms that they weren't added for
different reasons, i.e. separate bug fixes/use cases.

Change-Id: Ib384c84e2954bd303661386256053b3c1ad38239
Add atomic flavor access creation

This adds the ability to update the list of projects for a flavor
in a single go during create. This avoids a brief period of public
visibility between the time the flavor is created and assigned a
project.

Change-Id: I5c15c78809bfcb78e110c0d45dde8460a0ec98d6
Add Flavor object

This patch adds the Flavor object and associated tests. It looks
mostly like the corresponding DB object, but without a nullable
flavorid attribute (which isn't actually optional). It also
makes a loadable 'projects' field with the associated project IDs
in it to avoid another object/interface for this simple thing.

Related to blueprint compute-manager-objects

Change-Id: Ib50a4efe874d6f19f5fc1178eb253ec8487f3808
Merge "Add atomic flavor access creation"
Merge "Add Flavor object"
Make flavor_access extension use Flavor object

This makes the flavor_access extensions use the Flavor object instead
of calling into the compute/flavors.py file entirely.

Related to blueprint compute-manager-objects

Change-Id: I360c28ad2a239b34822ba9dda3b5c583c8c886b3
Cells: check states on resize/rebuild updates

When the API cell receives instance updates, check the task states for
any resize and rebuild states.  Make sure to only apply them if the
current task state for the instance is what we expect.  This will fix
any out of order messages from potentially stomping on re-setting the
instance to ACTIVE/None on finish of the actions.

Change-Id: Id79e35e29170ac2b8f42a955cecaae3072aba09c
Closes-bug: 1249072
Merge "Clean up test cases for compute.manager._check_instance_build_time"
Merge "VMware: Fix unhandled session failure issues"
Merge "Make flavor_access extension use Flavor object"
Merge "Cells: check states on resize/rebuild updates"