Nova network needs to take care of existing alias

Nova network should take care of existing aliases on bridge
interfaces when it adds address on top of the list.

Change-Id: Ife54c9eba64906406f7c44a66b596f3162ad16b6
Fixes: bug #1077066
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
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
Run libguestfs API calls in a thread pool

The libguestfs API is a binding to a native C library, and thus
it will block greenthreads. To avoid this all libguestfs API
calls need to be run in a threadpool. This can be done by just
wrapping the GuestFS object in an eventlet.tpool.Proxy object

Fixes bug #1132742
Change-Id: I877ad9e88442e41c9ad234503d9b1ddf1fb27408
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add API Sample tests for Snapshots extension.

Partially implements blueprint nova-api-samples
Modifies fakes to produce a real timestamp
Fixes bug 1126211

Change-Id: I8973d50fa67abbf6f96684ff8a0b898912f09caf
Remove unused nova.db.api:instance_get_all_by_reservation

Change-Id: I55192773eaa18eb81ffb2b5ec3567b09116b0d1e
Sync nova with oslo DB exception cleanup.

DB exceptions have moved to openstack/common/db/exception module so that
they can be shared with multiple DB implementations.

Deadlock checking was also added to oslo to consolidate with
DuplicateKey checking.  This allows us to clean up our
_retry_on_deadlock decorator in sqlalchemy/api.py

Fixes unrelated pep8 issue with duplicate test in test_compute also.

Change-Id: I7e985b384d1ef345e0d67c919b84b4faff869699
Rework instance actions to work with cells

In a cells setup an instance action is recorded at the global cell level
while events try to get recorded in a child cell compute node or
scheduler.  The event recording fails because it can't find an action to
link to.  This patch adds the recording of actions at the child cell
level, and changes the API extension to query the db in a child cell for
the record of actions and events.

This does not address the fact that an action is recorded at the global
cell level.

Bug 1132935
Change-Id: I5831f146397e7afa2d93d26c5d6f9abb9bc6670d
Migration 147: Prevent duplicate aggregate_hosts

If an aggregate_host record is already present, then the `upgrade`
shouldn't attempt to add it again.

Change-Id: Ib7ab10fa7c166ccaa3df6a96eb08c7ebcd0af38c
Fix redefinition of function test_get_host_uptime

First test_get_host_uptime was missing a parameter that the
second test contains.  So remove first test.

Fixes bug 1133062

Change-Id: Id886f4e52f45505117fd8e7bf30bc4d77cacd47b
Fix hacking.py to handle parenthesise in from import as

Fix bug 1133070

Support 'from os import (path as p)'

Change-Id: Ie2e5b3150efb6f47b16978f3de64fca37e1717a6
Migration 148: Fix drop table dependency order

The downgrade of 148 was broken because instance_actions_events has a FK
dependency on instance_actions but was attempted to be deleted first,
which caused the sqlalchemy to complain.

The fix is to reorder the table deletes in the downgrade.

Additional cleanups:

* Remove unecessary exception handling which masked errors

Change-Id: Iaac77ba0e81071f6bb39e5cc3b599a4138eb3cd2
Add missing import to fakelibvirt.

This module calls time.sleep(1), but was not importing the time module.
This fixes it.

Fix bug 1133056.

Change-Id: Ifbba2a98ccdd8d5e26ce466831618ccab9e0b462
Retry floating_ip_fixed_ip_associate on deadlock.

Update the floating_ip_fixed_ip_associate method of the sqlalchemy db
API to retry if it fails because of a deadlock.  The decorator that
handles this was introduced in e53e22271ed7e7a9b919d817a8eb50a1ecce16f8.
The related bug report shows that this method could benefit from the use
of this decorator.

Fix bug 1090016.

Change-Id: I0159470e6eb2f8017bcb3e659e7b119194dda920
Allow zk driver be imported without zookeeper

The zookeeper python module isn't widely available (e.g. not available
on Fedora), so allow the zk servicegroup driver be imported even if the
module isn't found.

This helps allow the generate_sample.sh script generate a sample config
file even without zookeeper installed.

Change-Id: Ic3b3bb75bcd2003150909ebd2c5724fa5093c346
Unpin Cheetah dependency version

Fixes bug #1133216

We've been pinned to the same version of Cheetah since May 2011:

  Cheetah==2.4.4

this was released in December 2010 and there hasn't been a release since:

  https://pypi.python.org/pypi/Cheetah/2.4.4

There's no particular reason to believe a future release of Cheetah will break
us (only 6 commits since 2.4.4 and they all look like bugfixes), so we should
change to:

  Cheetah>=2.4.4

Change-Id: Id3b22b84d2d693776f89ccb1d0c99d4e42fcab62
Unpin suds dependency version

Fixes bug #1133247

suds is used by the vmware driver and the dependency has always been
pinned to 0.4:

  67e63ba8 (Sateesh Chodapuneedi 2011-03-07 18:10:48 +0530 17) suds==0.4

0.4 was released in September 2010 and there hasn't been a release
since. In fact, there has only been 16 commits since then and none of
them look to break the existing API.

If there's no reason to expect the next version to break us, we should
unpin. Indeed, we want to know early if upstream does break its API.

Change-Id: Icd2bdd021093293b2e4261a00d063239a3c42ce6
Unpin routes dependency version

Fixes bug #1133258

It looks like we should be fine with 1.13 and have no reason to expect
future versions will break us.

Cinder and Quantum both require >=1.12.3 too.

Change-Id: Ice0649d98e2a46505503072c07509fe274f195b6