Push 'Error' result from event to instance action.

Currently a failed event stores an 'Error' result but in order to see
which actions have failed it would require grabbing each one through the
api to see the events.  This patch adds 'Error' to the message field of
the instance action so that any actions with failures can be seen from
the initial listing of actions on an instance.

Change-Id: Ieeb798c47211ab00fe5b767dc1f18a665549ba01
Adding ability to specify the libvirt cache mode for disk devices

In past versions of Nova it was possible to explicitly configure
the cache mode of disks via the libvirt XML template. The current approach
makes this a derived setting of either “none” or “writethrough” based
on the support of O_DIRECT. Whilst this provides a good set of default
settings it removes the ability of the cloud provider to use other
modes such as “writeback” and “unsafe” which are valuable in certain
configurations.

This change allows the cache mode to be specified on a per-disk type
basis. If a disk type does not have a cache mode specified then the
default behaviour remains unchanged.

DocImpact

bug 1086386

Change-Id: I3d296fe0b4b9b976db02db90ad69fd299cd2096a
sync oslo log updates

this helps address the issue where syslog gets overloaded and we
loose the ability to figure out what's going on in clients like
nova-manage

Change-Id: Iedde5ed4e8e23e204be4fa7a19e9514acf2ebf86
Standardize the coverage initializations.

Now when we measure coverage repeatedly, the coverage data of
nova-api is accumulated but the ones of other nova services are
reset each time.
This is due to create new "coverage" class each time
"_start_coverage_telnet" method is executed.

This patch limits creating "coverage" class the first time
the method is executed.

Fixes bug 1122720

Change-Id: Ia900c96113bee65362ccb7c4c1975535d814d835
Use a fake coverage module instead of real one.

Actually loading the coverage module was leading to odd concurrency
conditions where it was interfering with mocked calls. This changes
to stub out the coverage class with a fake one so that we don't have
to worry about collisions. It also modifies the coverage class to be
created lazily so it isn't automatically started at import time.
Finally it removes the hack in run_tests.sh ignoring the coverage
tests.

Fixes bug 1131023

Change-Id: I39de434454f8b0903f6311e731e215a93027bc91
Fix ComputeAPI.get_host_uptime

Remove host from the list of parameters
Fixes bug 1122552

Change-Id: I0fd6b9130a408bfd80d3bdd24ecad786adb0f151
import base_dir_name config option into vmwareapi

Fixes Bug 1126078

Change-Id: Ic834c9289ca0bcefbf8077939d07728daa98366f
Fix launching libvirt instances with swap

The code in

  commit 7be531fe9462f2b07d4a1abf6687f649d1dfbb89
  Author: Daniel P. Berrange <berrange@redhat.com>
  Date:   Tue Jan 15 20:43:48 2013 +0000

    Refactor code for setting up libvirt disk mappings

accidentally broken launching of instances where
the flavor had non-zero swap specified. This was
not caught due to complete lack of test coverage
for the '_create_image' method. This adds two
test cases for that method, exercising this bug.
It also fixes a bug in netutils which was not
handling a NULL network mapping, which is a valid
scenario for several callers.

Fixes bug #1131306
Change-Id: I214561ba3ec6440d11a5afb0665e6b6f990bd148
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Flush tokens on instance delete

Force console auth service to flush all tokens
associated with an instance when it is deleted.
This will fix bug 1125378, where the console for
the wrong instance can be connected to via the
console if the correct circumstances occur. This
change also adds a call to validate the token
when it is used. This check will ensure that all
tokens are valid for their target instances.
Tokens can become scrambled when a compute node is
restarted, because the virt driver may not
assign ports in the same way.

Change-Id: I0d83ec6c4dbfef1af912a200ee15f8052f72da96
fixes: bug 1125378
Add module prefix to exception types

Change-Id: If1b0eccc9c75553fdbb3280ab742b1f4d6ea7861
Merge "Fix ComputeAPI.get_host_uptime"
Merge "Flush tokens on instance delete"
Fix baremetal migration skipping.

The `have_mysql` function would only check for 'openstack_ci_test' and
not 'openstack_baremetal_test' yet was being used for the
baremetal-migration tests.

This resulted in tests to run that should have been skipped.

The solution is to have the test classes to define their configuraiton
requirements and then to pass these into the backend checking code
explicitly.

Change-Id: I436b5cfe4cace04e7bcccc2bed75b34948fe0272
Add missing ec2 security group quantum mixin

Fixes bug 1131441

Change-Id: Ifc25e1a9eb113cd28a5a5ed9d277480c262cd7f3
Migration 135: Fix drop_column statement

Change-Id: I1c7d03ddd471311d5b55a2e423515f6a5a8cfcb8
Remove function redefinitions

A number of tests have never been run due to another function having
the same name. Duplicate names have been changed and additionally
pyflakes check will now fail in such situations.

Also fix ovs ethernet driver test which was incorrect.

Change-Id: Icd93528395e65a24194a6ec5dfb8025a820d29b5
Migration 144: Fix drop index statement

When dropping an index related to a column, we need to make sure that
the `Index` object is removed the `Table` object, otherwise a subsequent
`drop_column` call to that same column will error out as it tries to
re-drop the index.

Change-Id: Ie6533b011ead1bc5dd2542041d50eb82e5654a55
BM Migrations 2 & 3: Fix drop_column statements

`drop_column` takes a string not a `Column` object.

Change-Id: I01d537f78e40a20b762439087a13e104b9d18d46
Fix migration snake-walk.

The original code was not actually running `downgrade` because it
attempt to `downgrade` to the current version.

The fix is to downgrade to the current_version - 1.

Change-Id: I69484039269a17e343404bff195a6f84af56972c
Add `post_downgrade` hook for migration tests.

This can be used by tests to assert the state of the database after a
`downgrade` has been run.

This patch also renames `_prerun_#` to `_pre_upgrade` to match.

Change-Id: Id2a100a8270835d1ef6f9908ff5b89e2b531bb3c