Instance groups: only display valid instances for policy members

When displaying the members we will validate that the members
are actually valid. There may be cases when the members of an instance
group are not all valid, for example the instance has been deleted.

This is part of blueprint instance-group-api-extension.

Change-Id: I77062ce14d337662254ca3be956620dda3f44cd7
Do not add HPET timer config to non x86 targets

HPET is a harware timer for x86 arch. Also, qemu option '-no-hpet'
is not supported on non x86 targets. This change does not add hpet
in the guest's timer config when the arch is not x86_64 or i686.

Closes-Bug: #1290362

Change-Id: I1b81d1c5ed4f900ed87d1ecbbb97d4fdb22405fa
network_info cache should be cleared before being rescheduled

If an instance fails to boot due to a non-networking error the instance
then gets rescheduled and launched on another compute node. In these cases
deallocate_for_instance() is called which deletes the network ports
allocated though the info_cache for the instance is never cleared. This patch
adds a call to update_instance_cache_with_nw_info() which causes the cache
to get cleared out. Note: the cache is only cleared if the instance hasn't
been marked for deletion. This is due to how instance_info_cache_update()
is implemented.

Change-Id: If967884c9a6276f5949a7a04b597cedcce12ba09
Closes-bug: #1285158
GlanceImageService static methods to module scope

A first step in refactoring/cleaning up the image API in Nova is
to get the image unit tests to be real unit tests, not functional
tests or using a fake Glance client. This patch merely moves three
static methods that were hanging from GlanceImageService and puts
these private functions at the module scope, where the rest of the
helper functions reside (these three for some reason were put as
static methods on the GlanceImageService instead of as private
functions in the module scope).

The next series of patches will modify the unit tests in
nova.tests.image.test_glance to pull out usage of the fake glance
service and use mocks to properly stress the edges of both the
v1 and v2 glanceclient client structures.

Change-Id: If998291bfdb98b1ebe2e46c4ac8fdbae0fcd4bd7
Related-bug: #1293938
Instance groups: cleanup

The patch set does the following:
1. use list comprehension for unsupported policy check
2. removes unused import

This is part of blueprint instance-group-api-extension.

Change-Id: Ia1f4203efd1e2ef5880765abc507bb7f9cdea6d6
Merge "Instance groups: only display valid instances for policy members"
Add a decorator decorator that checks func args

This patch adds a decorator for decorators that allows specifying the
arg names that the function being decorated must accept. If the function
being decorated does not accept the specified args, an exception will be
thrown during 'decoration', meaning import time usually.

If however the function accepts variable number of arguments, the
decorator will be a no-op as it is not possible to guess what will be
passed at runtime. This is however good enough for Nova's compute
manager decorators that inspired this work, as they decorate methods
with well defined and even versioned arguments.

Several decorators used in compute manager are now fortified with this
"compile time" check.

Partial-bug:#1296593
Change-Id: I00ebcc8a092fa0894ba8764699093f59a46b8647
Rename _post_live_migration instance_ref arg

This was causing issues with the wrap_instance_fault decorator, as it
expects the argument to be called 'instance'. Also it is being passed an
instance object now so instance_ref can be misleading.

This patch also moves all the tests for the said method to use instance
objects instead of a dict, as this is what is happening in reality.

Finally we secure the wrap_instance_fault decorator with a recently
introduced expects_func_args decorator so that we make sure this issue
does not go unnoticed in the future.

Closes-bug:#1296593
Change-Id: I140bfec2a52bf659a725a7dbe78ba5c527ed26de
Merge "network_info cache should be cleared before being rescheduled"
Merge "Do not add HPET timer config to non x86 targets"
Revert deprecation warning on Neutron auth.

This reverts the deprecation warning added in commit
e80cf75fc0f25f6279200f59a70fd7c6e4766b0f.

V3 supports domain + project uniqueness, which is much more usable
than ids - massively more so for deployers. The initial patch
deprecates name, when that isn't necessary or appropriate - using name
based auth is as valid as id based auth - we just need to namespace
it in V3.

For V3 operators should be able to create:

* A service domain
* A service/service project
* A service/neutron user

to replace the prior

* service tenant
* neutron user

structure without switching to ids.

Closes-Bug: #1290540
Change-Id: I51837b0dc1bc352c0bf315e383951486b3cac034
Merge "Instance groups: cleanup"
Merge "Add a decorator decorator that checks func args"
Merge "Rename _post_live_migration instance_ref arg"
Merge "GlanceImageService static methods to module scope"
Merge "Revert deprecation warning on Neutron auth."