Enforce sqlite-specific flow in drop_unique_constraint

The nova.db.sqlalchemy.apy.drop_unique_constraint method has a
sqlite-specific flow for dropping unique constraints because it can't
use alter table like mysql or postgresql. The code is explicitly
checking if the db engine is mysql or postgresql and then falls into a
block which assumes the backing db is sqlite. This can cause problems if
the backing db is not sqlite.

This patch simply switches the checks so that the sqlite-specific flow
is only ran if the backing db is sqlite, everything else will default to
the 'alter table' flow.

Change-Id: I23b9bf33d18df3ac36106d5800a8ecdd1a4018df
libvirt fix resize/migrates with swap or ephemeral

Fixes bug 1191608

The code was not properly guarding against backing files not
existing with QCOW2 images. As such, get_disk_backing_file() would
return None, then the subsequent call to basename() on None would
cause an exception.

This bug was introduced with the fix for bug 1185588 and commit
6e768363.

Change-Id: I4b1237ddf01b9398bfdc141180260136b36cae5a
Don't deallocate network if destroy time out

Fixes bug #1169057
Sames as bug 1180178, if libvirt returns time out error during destroy
an instance, we also can't deallocate the network of the instance,
otherwise the fixed ip of it may be re-used by another new instance,
and resulted in the new instance can't be accessed by the fixed ip.

Change-Id: I04dfd21bb1b7168abc71f39e836126a11dad6d8d
Preserve network order when using ConfigDrive

Pass network_info to be used by InstanceMetadata instead of fetching
it by API and losing originally requested network order. This is
similar to what has been done for "content" where the original data
is lost after the initial call.

This issue only affects the ConfigDrive code path as the original
network_info is used when using file injection.

HyperV and XenApi are still probably affected by the bug but
unaffected by this fix. The fix is the same for these drivers. Simply
pass a network_info and it will be used instead of fetching the
network info by API.

Change-Id: Ie673b725cb47bf491009db99f6cb1258d46b0a69
Fixes: bug #1156844
Avoid redefining host to none in get_instance_nw_info(...)

The host parameter is required and a part of the method signature.
When it is redefined from kwargs.get('host') the supplied value
gets redefined to None. This removes the redefinition and keeps the
parameter value intact.

Fixes bug #1194178

Change-Id: I779cbce909935a4b794c16cefb0128f16f8563fb
Notification support for host aggregate related operation

Add notification for the following operations related to host
aggregation:
1) Send notification when create a new host aggregation
2) Send notification when delete a host aggregation
3) Send notification when add host to a host aggregation
4) Send notification when delete host from host aggregation
5) Send notification when update host aggregation for aggregate
name and available zone
6) Send notification when update host aggregation meta data

Change-Id: I2dc42addb587c4765b41e464697f35b1f844fde9
Implements: blueprint notification-host-aggregate
Xenapi shutdown should return True if vm is shutdown

clean and hard shutdown vm methods return a False if the vm
is currently shutdown. It should return a True, so that its
return value can be used to determine if the vm is shutdown
or not.

Fixes: bug #1195587
Change-Id: I758c43d45b15c3ef231e9eee3ecac620a44db824
port Instance_usage_audit_log  API into v3 part1

This changeset only copies the v2 files into the appropriate v3
directories unchanged. The copy as-is will not be loaded by either
the v2 or v3 extension loaders. The second changeset will then
make the changes required for it to work as a v3 extension.

This is being tried in order to make reviewing of extension
porting easier as gerrit will display only what is actually
changed for v3 rather than entirely new files.

Change-Id: I671ee9b3a0061195e9f387d60a63f74acb36bbfa
port Instance_usage_audit_log API into v3 part2

This port Instance_usage_audit_log api into v3.

Partially implements: bp v3-api-extension-versioning

Change-Id: Ia76b00e167c8d4514799e825e48031e45e290ed4
Port scheduler hints extension to v3 API Part 2

Ports the scheduler hints extensions and the corresponding
unittests to the v3 framework. Moves the commented out tests from
the v3 version of test_servers to the config drive extension
unittests.

Partially implements blueprint nova-v3-api

Change-Id: If0164e3e80927662ec3b955df4642f03b2d18853
xenapi: Tidy up Popen calls to avoid command injection attacks

 * Rewrite xenhost._run_command and xenstore._run_command to use
   utils.make_subprocess and utils.finish_process
 * Change exception raised by utils.finish_process to retain information
   needed by calls in xenhost and xenstore

Change-Id: Idcdb50bededf0acde92f1774d6752043ba8f97ce
Fixes: bug #1074087
Use oslo.sphinx and remove local copy of doc theme

Use the new oslo.sphinx version of the OpenStack doc
theme instead of copying it into this repo.

blueprint oslo.sphinx

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Change-Id: I0bd91f7bb43f97b99051fed65b75fc05d5149cc8
Baremetal ensures node is off before powering on

During spawn(), ensure that a node is really off before trying to turn
it on. This fixes bug 1178919, in which a node that had previously
gotten stuck in a power-on state (eg, in the BIOS screen) would fail to
spawn() because the baremetal driver would send a power-on request, the
BMC would ignore it, and then baremetal driver would wait indefinitely
for a DHCP request.

Change-Id: Ie73e6ab488abe99c70ad3d149d702577941056d1
Port extended-availability-zone API into v3 part1

This changeset only copies the v2 files into the appropriate v3
directories unchanged. The copy as-is will not be loaded by either
the v2 or v3 extension loaders. The second changeset will then
make the changes required for it to work as a v3 extension.

This is being tried in order to make reviewing of extension
porting easier as gerrit will display only what is actually
changed for v3 rather than entirely new files.

Partially implements: bp v3-api-extension-versioning

Change-Id: I531a2d2f68a268d44eaef3a5af0a9c799787b188
Merge "Baremetal ensures node is off before powering on"
Merge "Port scheduler hints extension to v3 API Part 2"
Imported Translations from Transifex

Change-Id: Ib227bc8a4d27364e04374dbeb44f43f85e4d112b
Merge "Enforce sqlite-specific flow in drop_unique_constraint"
Merge "Don't deallocate network if destroy time out"
Merge "Notification support for host aggregate related operation"