Add CRUD methods for tags to the EC2 API.

This is an incomplete implementation of the EC2 tags API.  In EC2, most
resources are able to be tagged.  See
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html

In openstack, the only currently 'taggable' resource is an instance, as
it has an instance_metadata table associated.  So far, only instance
tagging has been implemented, but it is relatively simple to extend this
to other resource types by creating the associated model and api calls.

Additionally, in EC2 searches, shell-style globs are allowed, eg:
fo* will match fo, foo, foobar
fo? will match foo

This has been left to do at a later date.

DocImpact: Adds new API calls: CreateTags, DeleteTags, DescribeTags
See:
http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-CreateTags.html
http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DeleteTags.html
http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeTags.html

Fixes: bug #1096821
Implements: blueprint ec2-tags-api

Change-Id: Idf1108f6a3476cabdbdb32ff41c00aa4bc2d9ffe
Signed-off-by: Stephen Gran <stephen.gran@guardian.co.uk>
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
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 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
Move console scripts to entrypoints.

As part of the move of plugins to entrypoints, take advantage of the
entrypoints based console scripts, which will make our command line scripts
available for unittesting.

Part of blueprint entrypoints-plugins

Co-authored-by: Michael Still <mikal@stillhq.com>

Change-Id: I5f17348b7b3cc896c92263dd518abb128757d81f
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"
Merge "Move console scripts to entrypoints."
Merge "Add CRUD methods for tags to the EC2 API."