Add missing conversion specifier to ServiceGroupUnavailable

The message in the ServiceGroupUnavailable exception was missing the 's'
conversion specifier.

Fix bug 1183733

Change-Id: I54869431511a72c49ccf61f5e7b1a30607959423
Regenerate missing resized backing files

Fixes bug 1185588

The only way to reliably determine whether we are using a legacy
(pre-Grizzly) backing structure is to look at the backing file
reference for the instance/disk itself. Thus, if we determine the
backing file contains an underscore, we use the value following it
as our legacy_backing_size, which is then used to create the
necessary backing file.

Change-Id: I145f71068c972a604e5361ae79d6315286136786
Converts 'image' to json primitive on compute.rpcapi.prep_resize

The 'image' should be converted to primitive since it contains
complex structures. Today it works because it relies on
scheduler.rpcapi.prep_resize which does the conversion.

This is part of other changes that will move resize/cold migration
to conductor. scheduler.rpcapi.prep_resize will be moved and then
compute.rpcapi.prep_resize has to properly convert parameters.

Partially implements bp cold-migrations-to-conductor

Change-Id: Id89896bfb379ab9eb8bf13c3513b9290d88408fd
Refactors scheduler.chance.select_hosts to raise NoValidHost

This change is intended to refactor the method to be consistent
with the filter_scheduler.select_hosts implementation.

This method is called by scheduler.manager and it is exposed
through the scheduler.rpcapi. Thus, both implementations should
behave the same.

This change is needed by others that will move cold migration
to conductor.

Partially implements bp cold-migrations-to-conductor

Change-Id: I0f6fef43324cf829cdb26633874c537572423f77
Fix Keypair exception messages

`InvalidKeyPair` exceptions weren't raising the
proper error message. The reason was that the
error message was passed in as an `explanation`
keyword which isn't understood by `NovaException`,
and so is thrown away.

This is part of a patch set to improve keypair
error message reporting in both the Openstack and
EC2 APIs.

References bug 1187952
Change-Id: Ide319cb126955927d623972dffd573cd4c4314df
Improve Keypair error messages in osapi

The KeypairAPI code provides useful error messages that weren't being
percolated back through the OpenStack API. This patch addresses this by using
the original `message` when crafting the HTTPException objects.

References bug 1187952

Change-Id: I786a225010d912d7bfea5c01838ddcf43fd90d53
More KeypairAPI cleanups

* DRY up quota checking for new keys

* DRY up formatting of get_key/get_all_keys results

* Add tests for get all keypairs

Change-Id: I14a97c0f3cb3aa9b827d14002c21076a41942023
Adds check that the core V3 API is loaded

Adds infrastructure to be able to check that the core V3 API
plugins are present and raise an exception and abort if any are missing. The
list is deliberately hard coded though it is not yet complete and
will be expanded as the core APIs are ported and it is decided
exactly what will be considered to be the core API.

Partially implements blueprint v3-api-extension-framework

Change-Id: Ic2c1d5cd6836ee18819106558880682cf4cda487
Speeding up scheduler tests

Database access is costly in tests and many tests
don't actually need it. This patch provides a
simple way we can speed up the Nova tests by
providing a new base class, `NoDBTestCase` which
allows us to white-list tests not needing database
access.

The following speedups were observed:

    With TestCase:     Ran 265 tests in 17.080s
    With NoDBTestCase: Ran 265 tests in  9.478s

Further optimizaton could be done by fixing
`test_host_filters` to not hit the database. This
will require some effort though in order to
maintain the quality of test coverage since part
of what's doing is testing the code in the DB
layer.

Change-Id: Ic34c4c39d7f680ac501efb459fdeaa51331ffe1c
Export volume metadata to new instances.

Instances that are booted from volume currently miss out on glance
metadata that instances booted from images receive. By extracting
that data and passing it on in the create request we make it
available to both sorts of instance boot, fixing bug 1175571.

Change-Id: I8c01ba3065a909ca8e1805db9a10a423b10fe289
Update analyze_opts to work with new nova.conf sample format

analyze_opts is a tool to help clean out a nova.conf file by checking
for unused and default values set in your nova.conf

Change-Id: I01fff134f8906bff929c55bea8c152653d3e9760
BDM class and transformation functions

This patch adds the utility functions that will help us switch
between versions of block device mapping data.

In order to accomplish this, and to have a more structured approach to
dealing with block device mapping data in the future, this patch
introduces a BlockDeviceDict class which is a thin wrapper around a
standard dict that makes it easier to reason about which fields are
present in the dictionary, and introduces said conversion routines.

blueprint: improve-block-device-handling

Change-Id: I9370333059b8c9aaf92010470b8475a913d329b2
Fix db.models.Service description

DB models definition should be up-to-date with DB schema obtained after applying of
migrations. Currently, there are no tests enforcing this and it's really hard to
analyze what indexes should be added, and what indexes we have at the moment.

So the first step is it to fix all models, and add missing descriptions about
Indexes and UniqueConstraints in __table_args__ and use explicit 'nullable'
parameter in columns description.

Add missing 'nullable' parameters to all Columns

Add empty __table_args__ parameter to Table

There is no indexes and no unique constraints in this table at this moment.

blueprint db-sync-models-with-migrations

Change-Id: I9b31e8976f514e370d6b46076b469fe5e5c8e0f1
Added verbose error message in tests helper mixin

blueprint db-api-tests

Change-Id: I2fcfc50824de8965fe8521cde5f20d24e88eb8ae
Removed code duplication in conductor.api

Used inheritance to avoid logic duplication in conductor.api classes

Fixes: bug #1188577

Change-Id: Id0bedb974354177dc3c6f6562e836924bcaafb08
Enhance group handling in extract_opts

When there's 2 options with the same name, the script gets confused and
doesn't know in which group it goes. This fixes it, and fixes also the
template generation which is broken for various reasons:

- gettext.install was missing
- nova-rootwrap when imported calls exit() because it doesn't find a valid
  configuration file, so let's exclude it entirely anyway
- eventlet/greendns needs to be ignored for this

Change-Id: Iaa4e9a806e79032ce1675b46a6b7a7628c3eff89
Signed-off-by: Julien Danjou <julien@danjou.info>
Merge "Export volume metadata to new instances."
Merge "Update analyze_opts to work with new nova.conf sample format"
Merge "Fix Keypair exception messages"
Merge "Improve Keypair error messages in osapi"