More informative nova-scheduler log after NoValidHost is caught.

This patch adds a warning log entry for when a NoValidHost
exception causes a scheduling error. The NoValidHost
exception's message will be logged before reporting that
the machine went to error. Previously, all other exceptions
would show a stack trace. However, since the NoValidHost case
is skipped, a user may not understand why his/her machine
went to an ERROR state. This patch seeks to remove any
confusion.

Change-Id: I0f01b1095251f5c659fe010c7376f3f6bc56babe
Closes-Bug: 1336977
objects: Fix InstanceGroup.obj_make_compatible()

The obj_make_compatible() method of the InstanceGroup object
incorrectly assumed the format of the version argument was the version
broken down into int() parts.  It comes in as a string and must be
converted.

Change-Id: Id2724c5029202f001e5a2b4371f030b65c72fdfd
objects: Add base test for obj_make_compatible()

A previous commit fixed a bug in obj_make_compatible() of the
InstanceGroup object.  While fixing that, I added a test targeted at
that object.  This patch adds a test that calls obj_make_compatible()
on every past version of every object.  It doesn't actually test that
the data is converted, but it makes sure that calling the method
doesn't blow up on something basic like expecting the wrong format of
the version parameter.

Only one object had to change for this test to work, and that was a
test object.  It assumed a field was always set, and it's not in the
case of this test.  However, the field in question is not actually set
as nullable, so it *should* be set.  However, the way these methods
are implemented elsewhere, they never assume the field to be set and
present in the primitive version of the object.

Change-Id: Id56b2f9763cfcb99a3c4a2d56329485c5e9c3b5c
Remove duplicated code in test_user_data

In test_user_data, there is duplicated code for creating a request.
In addition, there is an internal method which works as almost same
as the duplicated code.
This patch makes the tests use the internal method and removes the
duplicated code for cleanup.

Change-Id: Ie87cc14a3ac67bc1262de155dc0a1dcf5c5e7d9a
Create compute api var at __init__

No need to create compute api object at every func call.

Change-Id: I723cb5e26b2de68e1ea8bdb8505567030eb98406
Allow to create a flavor without specifying id

On current v2 API, "create a flavor" API allows a request without
specifying "id" parameter. The API of v3 API, which is source of
v2.1, doesn't allow it now. However, it will cause a backwards
incompatible issue when implementing v2.1 API.
This patch makes v3 API allow it.

Partially implements blueprint v2-on-v3-api

Change-Id: I2d3fda323df57f8c0c116347e3c4a38c807de31b
Backport V3 flavor extraspecs API unit tests to V2

This patch backport some of the V3 flavor extraspecs API unit tests
to V2 unit tests.

V2 flavor extraspecs API does not raise HTTPBadRequest error in case
provided extraspecs key is not string. It raise the TypeError instead.

This patch also correct that and raise HTTPBadRequest in such cases.

Change-Id: If73552943a8aa9b714d6748278311e816ec3daf7
Merge "Create compute api var at __init__"
Merge "objects: Fix InstanceGroup.obj_make_compatible()"
Merge "objects: Add base test for obj_make_compatible()"
Merge "More informative nova-scheduler log after NoValidHost is caught."
Merge "Remove duplicated code in test_user_data"
Merge "Allow to create a flavor without specifying id"
Merge "Backport V3 flavor extraspecs API unit tests to V2"