Improve performance of driver's get_available_nodes

get_available_nodes() is called every time an instance is updated.  That
ends up calling get_host_stats(refresh=True), resulting in a
libvirt/XenAPI/etc call.  On a build of a new instance when the instance
record is updated often (task_state and progress), this results in a lot
of unnecessary driver calls.

This changes get_available_nodes() to take a refresh kwarg to pass
through to get_host_stats(), defaulting to False so that it uses
the cache.  Places that used get_available_nodes() and are sensitive to
stale data are changed to add refresh=True.  Also adds a helper driver
method for 'is_node_available'.  And make sure that even if drivers'
get_host_stats() methods get refresh=False that they refresh when they
have no stats.

Fixes bug 1210264

Change-Id: I22c8d70e3e70f2d2421915da66c2618688e0db2b
Sync gettextutils from oslo-incubator

Partially implements bp user-locale-api

Change-Id: I1a053d9d0ad65ca90cac86196da68900b8fe112d
Enforce compute:update policy in API

Now that compute/api.py:update() is no longer being called for instance
updates the policy check is no longer enforced.  This adds policy
checking back in at the API level so that the compute:update policy will
continue to function as it did before.

Bug 1212807

Change-Id: I365ad8ac2845d914deefb841c314a50f4869dba0
Fix cells manager RPC version

A previous patchset forgot to bump the version to 1.19.

Change-Id: Iecadcdcc4d75b9e9295f216b3375bfbf852a77e3
Refactor integrated tests to support V2 and V3 API testing

Refactors the integrated test classes so they can be used
for both V2 and V3 API testing. No actual V3 testing is
added in this changeset.

Partially implements blueprint v3-api-unittests
Partially implements blueprint v3-api-specification

Change-Id: Ic7d7b513c3bc19ac1962c0a8489b55e9685fb7c0
Add passing a logging level to processutils.execute

Previously, processutils.execute always logged what commands were
run at DEBUG level.  This is usually fine, but sometimes the caller
wants to log particularly important commands at INFO level instead,
and oslo should allow that.

This is oslo-incubator aa5b65882.  No other significant changes had
been made to processutils in oslo since the last sync.

Change-Id: I09dad3759bf2f759b297ee19205cf0460b9a6baa
Set launch_index to right value

Fix bug 1212648

When boot multiple instances in one request, the launch_index
was not increased.

The fix was increase the launch_index one by one for each instances
in one request.

Change-Id: I27dde8cfae52853d33277c3d8e0e65c91bc6280b
Merge "Set launch_index to right value"
Merge "Fix cells manager RPC version"
Merge "Sync gettextutils from oslo-incubator"
Merge "Enforce compute:update policy in API"
Unit-ify the compute API resize tests

Move resize related compute API tests to test_compute_api and make them
unit tests.  This makes test changes easier when converting to objects.

This also caught a couple things where the cells compute api class was
not in sync that don't really end up being bugs, but need to match for
tests to pass.

Change-Id: I194310beb5e821e4a8262310d1bb80e0747e1c43
Convert admin_actions ext tests to unit tests

The tests for the admin_actions API extension (or v3 plugin) are
stubbing out conductor methods, which creates a lot of pain when
compute_api internals are changed.  Convert these tests to unit tests,
checking only that the appropriate compute_api methods are called with
the correct arguments.

Change-Id: I16634efa2397b36afa15b90712bfd678325bc049
Add scheduler utils unit tests

They were missing... although there is some testing via some conductor
tests that are not completely unit-y.  Those will be adjusted next.

Change-Id: I696dd8ff264fffb3ae015c3ae653c0799c60cecf
Fixup some non-unity-ness to conductor tests

This moves some conductor compute task tests into the test class that
only tests the manager side.  It also removes testing of
scheduler_utils's set_vm_state_and_notify method as that is already
tested separately.

Change-Id: I30bd3897311870b10c8ec65182c81d341a904485
Merge "Improve performance of driver's get_available_nodes"
Add migration with missing fkeys

There are few ForeignKeys that had been skipped in migrations
and declared in models.
This patch adds these relationships into db by new migration.

bp: db-sync-models-with-migrations

Change-Id: I63e6a853ec16b80ea52b1c0e8a94f8f60819312c
Fix project_user_quotas_user_id_deleted_idx index

The project_user_quotas_user_id_deleted_idx index in the 203 migration
for the project_user_quotas table was using the wrong column, it should
be using user_id instead of project_id since there is already an index
for the project_id column (defined directly above it).

Fixes bug 1205693

Change-Id: I6899afe5b57432345f69b4ee91ef947a4b9ef5c9
Merge "Refactor integrated tests to support V2 and V3 API testing"
Merge "Fix project_user_quotas_user_id_deleted_idx index"