Added sample tests to FlavorDisabled API.

Partially implements blueprint nova-api-samples
Fixes bug 1070161

Change-Id: I889a5b2e85d31fda1e9a8a82043ba7e9ddf1b7a6
Fix race condition of resize confirmation

Currently, the db update of migration status is after the db update of
instance's vm_state in _finish_resize, so a race condition occurs when an
instance's vm_state is updated but the migration status doesn't, and at
this moment a resize confirmation is performed, then an exception
'MigrationNotFoundByStatus' is raised.

Fixes: bug #1066140

Change-Id: I1dac98cc99d3491c92faaad2b9dcc40d7c0524b5
Add html reports to report action in coverage extension.

This makes a few minor cleanups and 2 additions to the
coverage extension. First, it adds a new optional field to the
report action: 'html'. This will generate an html report instead
of either the text or xml reports that the extension can
generate.

The second change is that it adds a return for the stop action.
Now upon successful completion of the stop action the directory
where the coverage data files will be returned.

Change-Id: If1aa25fc7237e9bb5100d2a4a8e560f0a68eba61
Eliminate race conditions in floating association

This makes associating and disassociating floating ips atomic and
idempotent. This means multiple concurrent messages will not leave
behind iptables rules and concurrent request will not cause odd
failures.

Fixes bug 1092762 and bug 1092761.

Change-Id: Idbcad6c1d2a3d4881cf7180b848ed3844fac4054
Remove inconsistent usage of variable from hyperv.

Portions of the code use instance_name, while others use
instance['name']. In some cases, within the same function. See
lines 123, 153, and 156.

Change-Id: I69763e62a1db79b4c5a4468104fd26ad9b3aad5a
db.security_group_rule_destroy() method performance optimization

1 db requst instead of 2

blueprint db-session-cleanup

Change-Id: I094632c422aa9d10278c1b85ec9f4d51a54541b1
Fix error in test_get_all_by_multiple_options_at_once()

We should not use 0 as id. It will conflict with db-unique-keys.

Since soft_delete() stores `id` value in `deleted` column, and
checking whether entry is deleted softly is made through comparison of
`id` and `deleted` column values, created entry will look like already
deleted softly.

blueprint db-unique-keys

Change-Id: Icb7a4880886301a3cc72c6ea0e455b867952812e
Ensure that Quantum uses configured fixed IP

Fixes bug 1094897

The fix ensures that the fixed IP address specified by the user
is correctly passed to Quantum. That is, when the Quantum port
is created it is created with the specified IP address.

Change-Id: I8191ac2497037e2592b0679962e4606cd24d7844
Add unit test to revert resize server action

Add a unit test to check the revert resize to an invaid server

Fix bug: 1088874
Partially implements blueprint nova-v2-api-audit

Change-Id: I19128ac1a99e85721e7911176fa6d6c78bd5c256
Add unit test to update server metadata

Fixes bug: 1088878
Partially implements blueprint nova-v2-api-audit

The bug description points to 4 situations to be tested, although those
situations are already tested on create metadata tests which use the same
method as update_all to operate over metadata (_update_instance_metadata) so no
more tests are needed.

Change-Id: Ifae3c69c0e00c361ae36f5a8dede835c96568d11
Fix spelling mistakes in nova.virt

Change-Id: Ic5ff80af956726b768610290e4fae7dd46549711
Delete pointless nova.virt.VIFDriver class

There is a nova.virt.VIFDriver class which the hypervisor
VIF drivers inherit from. None of the hypervisor subclasses
pay any attention to the API contract defined to the parent
class. Some of the hypervisors don't bother trying to use
the VIFDriver class at all (hyperv, baremetal).

It is not worth trying to make the hypervisor subclasses
follow the same API contract, since the base parent class
offers no re-usable functionality of its own. The hypervisor
base classs nova.virt.ComputeDriver also has no need for the
VIFDriver API to exist, since its integration point is the
'plug_vifs' method.

As such the nova.virt.VIFDriver class serves no purpose
other than to mislead reviewers into thinking there is a
common API where none actually exists. It should thus be
deleted

Change-Id: Id287f7e66143a248a5f106e010510a3f09d2b1e7
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
fix resize of unpartitioned images with libguestfs

Following on from I9c974e138ff90e8b7a5a40f5b31dcdb25a59622d
Ensure that the libguestfs path also throws a NovaException,
handled by can_resize_fs().

* nova/virt/disk/vfs/guestfs.py (setup): Move the debug message
and guestfs handle outside the exception handler as we
don't want to map failure of those to a NovaException
that indicates an issue with the image as opposed to the
nova code or libguestfs installation.  Change to a more explicit
exception thrown by guestfs, so as to avoid masking other issues.
(teardown): Remove redundant calls to str().
* nova/virt/disk/api.py (can_resize_fs): Cleanup the debug messages,
and use the newer vfs API directly, rather than the slightly
hacky call to inject_data() with no data to inject.

Fixes bug: 1094373
Change-Id: I3e1305cf6bb64278a8caf37e4c5005cb9683f632
Merge "fix resize of unpartitioned images with libguestfs"
Merge "Added sample tests to FlavorDisabled API."
Merge "Remove inconsistent usage of variable from hyperv."
Merge "Fix spelling mistakes in nova.virt"
Merge "Add unit test to revert resize server action"
Merge "Add unit test to update server metadata"
Merge "Fix race condition of resize confirmation"