Remove duplicate test from V3 version of test_hosts

Removes duplicate test_host_startup_service_unavailable
test.

Partially implements blueprint v3-api-unittests

Change-Id: I87327fa577666bcd2924432253d02cd67865e948
Fix changes_since for V3 API

The V3 API changed the changes-since parameter to changes_since
for consistency with other parameters. However, the db level
expects changes-since as the filter. So this change transforms
changes_since to changes-since before passing it to the compute
layer.

Closes-Bug: 1220045

Change-Id: Id34ffe8aa75b20d11dcb1b4a9ba36e2586dae1e3
xenapi: Fix download_handler fallback

In order to make image-download a bit more robust, we attempt to download from
a preferred handler and if that fails, we fall back to a default handler.

If the preferred handler *is* the default-handler, then we should just raise
the exception instead of retrying.

The existing code was checking to see with whether the handler *instance*
compared as equal to the default-handler *instance*. Since the two objects are
instantiated separately, they'll always be different objects, so never compare
as equal.

The correct check is to see if the handler is an instance of the default
handler's class.

Fixes bug 1210659

Change-Id: Id038d221fd2f90c36673f30d4ff8acdc8dbf098e
update .mailmap

Change-Id: Ibdad9607e4a046cb0c78b68ae4255679e17ff218
Add missing indexes back in from 152

Migration 152 lost indexes on upgrade. This was fixed in migration 194
and 212 but one index is still missing on the migrations table.

This patch ensures the indexes are present on downgrade of 152 to be
consistent and also adds the missing index back in with a new migration.

Fixes bug 1208652
bp: db-sync-models-with-migrations
Change-Id: I9f42b3fbe891187382135f8e789f13bb2d35d450
Only return requested network ID's

Only return the requested network ID's and not all of the
public networks. This will also include 'shared' networks.

Fixes bug 1221320

Change-Id: I21ba4586c6e431b0dd1a87a9e5e493fae1b08357
Remove duplication in disk checks

Split the image and fs resize checks into separate methods since they
are used in different ways. This also strips one redundant size check.

Change-Id: Ie2381fa4ecd5264f2dd3ec3b0350df40376d0e34
Use test.TestingException where possible

Instead of calling 'raise Exception()' in a stub, use
tests.TestingException and only catch that exception.  This will make
sure the test have less false positives and hide other exceptions.

Change-Id: I384c93e220d570abec25dcbacead0aa3bc33cbcf
Partial-Bug: #1223605
Make Instance.save() log missing save handlers

Also, fix the name of the _save_fault() handler to be what it should
be, which is what triggered the ungraceful handling of this bug in
the first place.

Change-Id: I160f42b130810134135d2a22198fc0b66a7af585
Closes-bug: 1223957
Make v3 API  versions extensions core

Adds the versions extension to the core list.

+DocImpact

Partially implements blueprint nova-v3-api

Change-Id: I214db47a56bff160764340bd6793d7612d043ef3
Remove unused method in scheduler driver

Scheduler driver code clean, remove method encode_instance in scheduler
driver, since it's unused since Folsom.

Fix bug #1224783

Change-Id: I8bd7ee55a4b522d4c628c7f652833dfa20342b33
Translate more REST API error messages

There were a few exception messages that were not being
translated because they were being wrapped and modified
before being turned into wsgi.Fault objects by
FaultWrapper. This adds some translation handling to
the FaultWrapper so we can get these messages localized
to the client's language specified in the Accept-Language
header.

Additionally adds a test to verfiy FaultWrapper is
translating any exception messages that can be.

fixes bug 1225226

Change-Id: I3847cff0ac4b37f57eb04b27150c4e0d1ea23f29
Move required keymgr classes out of nova/tests

Currently the Nova default keymgr implementation tries to
import classes from nova/tests. This could be a very bad
thing for production deployments which may not include
code from nova/tests.

This change moves two required modules (single_key_mgr and
mock_key_mgr) into the nova/keymgr tree.

Fixes bug: #1224526

Change-Id: I683b0245ab6b6acf8a4ba26f96d8c505f7c7cac8
Drop unused logger from keymgr/__init__.py

Change-Id: I930be566f68c206d94f0e42432fe93b4135bcd42
Wire in ConfKeyManager._generate_hex_key!

Rename _get_hex_key to _generate_hex_key so that this
key manager works with the super class it extends.

In making this change we also need to initialize the hex key
in the constructor before initializing the super class. Not
doing so causes test failures.

Fixes bug: 1224602

Change-Id: I9a6bd9bf96bf74a08e607af811ebbe9622b994f3
Don't use sudo to discover ipv4 address.

Running unit tests on a plane (with no network) and I recently
discovered that the Nova unit tests were prompting me for sudo.

A quick look showed the following command being executed:

 nova-rootwrap /etc/nova/rootwrap.conf ip -f inet -o route show

This patch updates utils.get_my_ipv4_address() and
the private _get_ipv4_address_for_interface function so they run
commands without using sudo.

Change-Id: Id9c33c9383a9f5b2e1fce1b0f5afcc2a27a271c6
Merge "Move required keymgr classes out of nova/tests"
Merge "Drop unused logger from keymgr/__init__.py"
Fix rename q_exc to n_exc (from quantum to neutron)

The patch fixes one file where q_exc was not renamed to n_exc during
the quantum to neutron rename.

Fixes bug: 1226162

Change-Id: I77625324b378bbe0e1461e5fea77c9747ca33624
Merge "Remove unused method in scheduler driver"