Fix _drop_unique_constraint_in_sqlite() function.

We got incorrect unique constrains in function
_drop_unique_constraint_in_sqlite().
New function `_get_unique_constraints_in_sqlite()` was added to fix it.

Change-Id: Iebb4c0e6c3e6a069ba5cde2fdb2a2ff1200b826f
Fixes: bug 1184526
Add yolanda to the mailmap.

Noticed a duplicate entry in the AUTHORS file, added to .mailmap.

Change-Id: I649df9d7273347bec72076dc16a5c2217d1bf1c1
Refactor libvirt driver exception handling

Centralize exception handling for id based instance lookups in new
method _lookup_by_id().

Change-Id: If8d215b85fabf235afcf78a9203378fbb26e68db
Sending volume IO usage broken

This is my fault, I didn't test the sending of notifications
enough when fixing bug 1182102, when the volume IO usage notifications
were been sent too often. This was merged as part of
https://review.openstack.org/#/c/29915

The issue was that the code worked for the first IO usage event (the
one I looked at). Then when constructing the event payload for the second
and following IO usage events the code path ended up comparing a datetime
object from the db with a cached string representation of the last_refreshed
date that was passed into the conductor via the RPC.

Since last_refreshed argument to vol_usage_update in the db layer is
not needed and is causing these issues. I have removed last_refreshed
argument from the db layer and deprecated it from the conduction API.

Change-Id: I2030eb7912c56134ea688a6e8bbfcdeddca28307
Register libvirt driver with closed connection callback

libvirt v1.0.1 and later support a callback to alert clients
when the connection is lost.  The libvirt driver will now
register for this callback when available so that the driver
can properly reconnect.

Fixes: bug #1154635
Change-Id: Ie5f1b69cf6f0655022148386cd2be9955d37b467
Make sync_power_state routines use InstanceList

This makes the periodic sync_power_states task use InstanceList
objects instead of querying conductor directly. This also affects
handle_lifecycle_event() as well, which now uses Instance to
fetch the instance for the event.

Note that none of the power state sync code was covered by unit
tests, so this adds that as well to verify the behavior and instance
object usage. Also note that compute_stop is already instance-object-
ready, so passing one to it is okay.

Related to blueprint unified-object-model

Change-Id: I4e34e0a2b9db77468305aaf1782feb74bcfdccbd
Merge "Add yolanda to the mailmap."
Merge "Sending volume IO usage broken"
Remove usage of locals() from xenapi package

fixes bug 1171936

Some minor formatting cleanup was done as well

Change-Id: If52c2bf1eb38b5d0072a783bd944304576a70d13
Fix the wrong reference by CONF

CONF.set_defaults(CONF, web='/usr/share/novnc') should be
CONF.set_default('web', '/usr/share/novnc')

Fixes: bug #1190628
Change-Id: I7ff12d10ed423fa6518b8674b80d0e1cc1787a8b
Backup and restore object registry for tests

Without this, the object registry can become cluttered with test objects,
which may conflict with each other, depending on the order and pairing
of testr processes.

Related to unified-object-model

Change-Id: I77d3beebfb963cdc24c49eebb38ca8a768c69503
Fix obj_load() in NovaObject base class

The obj_load_attr() method is correctly used in the field getter,
but incorrectly provided in the base class (without the _attr
suffix). Rename that and add a test for the base class that makes
sure this method gets poked appropriately.

Related to blueprint unified-object-model

Change-Id: I3b010ef727fed2f59fbb3d7173078b1dbc4b81f6
Merge "Backup and restore object registry for tests"
Merge "Fix obj_load() in NovaObject base class"
Merge "Make sync_power_state routines use InstanceList"
Merge "Fix the wrong reference by CONF"
Merge "Fix _drop_unique_constraint_in_sqlite() function."
Merge "Register libvirt driver with closed connection callback"
Merge "Refactor libvirt driver exception handling"