Add generic customization hooks via decorator.

Hooks add the ability to insert custom code around operations that
declare a named hook:

e.g.

@hooks.add_hooks('create_instance')
def create_instance(....):
   ....

The above hook allows Hook objects to be run 'pre' and 'post' the
execution of create_instance()

Hook objects are discovered via the setuptools entry point group
'nova.hooks'.

Change-Id: I3961df12ef415085de7459438967edacc34500c2
remove session param from certificate_get

remove unused session param from certificate_get()

blueprint db-session-cleanup

Change-Id: I9bcf8c73507cd3d8beb60a262d47368206652e74
update mailmap to add my perferred mail.

Change-Id: I5b0a92683b73e0bd4219f8faa9849ea71b8a3c8a
Fix minidns delete_entry to work for hostname with mixed case chars

Fix commonly used methods like parse_line and qualify to return
lower case strings. Review incoming method arguments to make sure
we are using comparisons where both strings are in lower case.
Fix a few spots where the input parameters were not in lower case
Added a test case for a specific problem that showed up in
the devstack gate job.

Change-Id: Ia204bde26cee5a1b22e8240a5310c5d45ffafb32
Fix positional arg swallow decorator

The update() method in the hosts extension is decorated with @check_host
but the function returned by decorator takes a kwarg which shadows the
'body' positional arg of the update() method.

i.e. if you call:

  controller.update(req, id, body)

then the body arg gets passed to the wrapper as its service kwarg and
never passed through to update(). We can see how the tests are all
passing body as a kwarg to avoid this.

Remove the service arg from check_host() but also from _list_hosts()
since the only place it is used is in the tests.

Change-Id: I12aab582c15c25fd35ecda005341291450c7efdc
Avoid vm instance shutdown when power state is NOSTATE

Occasionally when nova uses libvirt lib to query hypervisor
xen the instance state of vm_power_state may end up
with a NOSTATE value. Existing code shuts down the instance
when we hit this state. Remove the check for NOSTATE
to avoid shutting down the instance.

Fixes LP #1085771.

Change-Id: I0025f6800b6ca9cd3d7c7e6119b9a819571bd13c
Update tools/flakes to work with pydoc

Change-Id: Ib141553017aa88d6edb65b5d51c06740699a2480
Merge "remove session param from certificate_get"
Merge "Fix minidns delete_entry to work for hostname with mixed case chars"
Fix bugs in test_migrations.py

This fixes two related issues in nova/tests/test_migrations.py.

First, the snake_walk flag was only set to True for the first test run
out of TestMigrations. setUp() always set snake_walk to False initially
then would only update the value if TEST_DATABASES was empty.
TEST_DATABASES was only empty during the setUp() of the first test.
Fix this by resetting test_databases before each test.

Second, because snake_walk was always False when test_walk_versions
performing the snake walk version of the database migrations was never
tested and broken. When downgrading from version X to version X -1 of a
database version X must be passed to the migration tool as version X
contains the downgrade path for that particular version. Set the correct
versions when snake walking the DB migrations.

Part of blueprint grizzly-testtools

Change-Id: I8d4d9ee8efe46b4690dd6cbe95879e88aaeb0b5a
Sync RPC logging-related bits from oslo

These are the RPC common changes for squelching exception
logging, oslo change I4e7b19dc730342091fd70a717065741d56da4555

Change-Id: I8b5040d0ec2e70b8cc1e784151df60ac2bf3f457
Order instance faults by created_at and id.

It is possible that instance faults have the same created_at values so
ordering on that field alone is not deterministic. Add an additional
order by clause to order descending on id as well.

I am not sure if the order by exists to make tests pass; however,
without the additional "id" the tests do occasionally fail. See
http://logs.openstack.org/15078/18/check/gate-nova-python26/10709/console.html
for an example failure. If order does not actually matter we may want to
make the test smarter instead.

Part of blueprint grizzly-testtools

Change-Id: I1c7a07669846c832270631c1734dae509dba7586
Simplify how ephemeral disks are created and named.

Resolves bug 1087028.

Change-Id: Ife7ec43cf76cf04a98f1db2135f9149a2eefb55d
Merge "Sync RPC logging-related bits from oslo"
Merge "Simplify how ephemeral disks are created and named."
Reset node to source in finish_revert_resize()

bug 1087760

Change-Id: I8c50543de1efc48b9dde0dc045fcd52bc89b727b
Merge "Reset node to source in finish_revert_resize()"
Use conductor for migration_get()

This patch removes direct database accesses for looking up
migrations by id, and instead queries conductor.

Related to blueprint no-db-compute

Change-Id: Ia7df121971b14b1eb4ce65063246968b3603309d
Prevent creation of extraneous resource trackers.

Defensive logic to stop creation of extraneous resource trackers.

Change-Id: I8d190990c4020eff85584cdb39d4b91104b7450e
Fix network manager ipv6 tests.

When using a test runner that runs tests in a different order than
nosetests it is possible that IPv6AccountIdentiferTestCase tests run
before CommonNetworkTestCase. If this happens
IPv6AccountIdentiferTestCase sets the ipv6_backend to account_identifier
which causes the regexes in
CommonNetworkTestCase.test_get_instance_uuids_by_ipv6_regex to not
match.

Explicitly set the ipv6_backend to rfc2462 in CommonNetworkTestCase's
setUp() to ensure the regex's match the addresses in the fake network
DB.

Part of blueprint grizzly-testtools

Change-Id: I0fdb5c3d4130c6cf23b22bca6645581f603a79c5