Guard against content being None

`content` can be passed in as None, so we need to set it to the empty
list if that occurs.

This also fixes the bad-practice of using a mutable data-type as a
default argument.

Fixes bug 1163598

Change-Id: Ie991c9452a21cfb036d3955a094ec345805d63d1
Grab instance for migration before updating usage

Updates _update_usage_from_migrations so that it grabs the instance
associated with a migration before updating usage.

Bug 1163622

Change-Id: I64acef912ae71ea5c7fb66e9fcaafe5750c63eaf
After migrate, catch and remove deleted instances

On the host init, starting with a deleted instance which has been
previously evacuated from the host results in an InstanceNotFound
exception. Catch and log this, and then call driver.destroy() so
that the hypervisor driver can clean up the deleted instance.

If we don't do this during host init, it will cause problems during
periodic tasks.

Fixes bug 1155152

Co-authored-by: Devananda van der Veen <devananda.vdv@gmail.com>

Change-Id: I979a698b8e739b9335f37b81e789285f91977a8e
Fix a typo in attach_interface error path

This prevents an attach failure from raising the proper exception to
the caller.

Change-Id: I51559cf395fc99738127b7a443437197d15f3d4c
Merge "Grab instance for migration before updating usage"
Merge "Fix a typo in attach_interface error path"
Fix legacy_net_info guard

The existing code assumes that `legacy_net_info` is always in legacy
mode, meaning a list of tuples which causes it to break when passed a
new-style NetworkInfo object.

Fixes bug 1164152

Change-Id: I2131d9b24045cd7531454b65d97776b11ec3ab02
Simplify and correct the bm partition sizes.

The sfdisk code that landed uses -D, which ends up subtracting space
from the first partition - this plays havoc with precisely sized disk
images due to a bug in the automatic adjustment code. Instead we
directly specify the spare space to be allowed.

Additionally, sfdisk can be used much more simply, avoiding any room
for us to make arithmetic errors, and reducing the opportunity for
race conditions with udev so this change does that.

Change-Id: I7f95e867d8775f49698cbbf4b1be40e69db9d538
Imported Translations from Transifex

Change-Id: I2abbf4025e7467a090efba9d1f7820a1fcac29d1
Fallback to conductor if types are not stashed.

If the instance types are not stashed, fallback to
the conductor API to retrieve them.

bug 1164110

Change-Id: I1f0ef48e072f8580980de5bd8d43cf2206cd7d27
Remove deprecated Grizzly code.

Now that Havana development has started remove code deprecated in Grizzly.

Change-Id: Ie3e7611347c334c359dea98d759345b97c66c9c1
Merge "Guard against content being None"
Merge "Imported Translations from Transifex"
Merge "After migrate, catch and remove deleted instances"
Merge "Fix legacy_net_info guard"
Merge "Fallback to conductor if types are not stashed."
Merge "Remove deprecated Grizzly code."
Optimize resource tracker queries for instances

instance_get_all_by_host_and_node() had 4 different joins being done.
The resource tracker is the only consumer of this method and does not
need the joins.  This optimization will save many unnecessary rows from
being fetched during the update_available_resource() audit task.

Change-Id: I414c219e4563634e270007fe3d0fa980b273e795
Merge "Optimize resource tracker queries for instances"