Deprecate old vif drivers.

As per commit 4c0cecd3 (Change-Id I292c2fd7aa0c32b1c91d737152ed8e54ea2cf6ac)
Deprecate:
* LibvirtBridgeDriver
* LibvirtOpenVswitchDriver
* LibvirtHybridOVSBridgeDriver
* LibvirtOpenVswitchVirtualPortDriver
* QuantumLinuxBridgeVIFDriver

Change-Id: Iad854dfe91aaa18622f78aa92746d3ea2f986960
Raise correct exception for duplicate networks

When using Quantum, if duplicate network ids are passed in on a
nova boot, nova-api raises a NetworkNotFound exception, which is
not correct.  This change causes it to raise a NetworkDuplicated
exception instead.

Fixes bug 1165088

Change-Id: I4f1f9aa5e1fa0e740b78e67760d924e2dd1d4d98
Encode consoleauth token in utf-8 to make it a str

This is needed for memcached backend, because the key cannot be a
unicode object in any of the exposed functions.

Fixes bug 1164784

Co-authored-by: Stanislaw Pitucha <stanislaw.pitucha@hp.com>

Change-Id: Ieb1429116d96eefe97564fe92631063dc16117cb
xenapi: Make _connect_volume exc handler eventlet safe

`forget_sr` blocks and so clears the exception state causing the
subsequent raise to try to raise `None`, which fails.

Fixes bug 1167515

Change-Id: I18562c7389b152a6490d352c5a8d36934288f47d
Fix bug in os-availability-zone extension.

Fixes bug 1167956.
The call to get the list of availability zones (GET V2/os-availability-zone)
doesn't hide internal availability zone if all services in that zone are
disabled.

Change-Id: I2c49ad68c2ee5ddea0536dfa770f649fbb392b63
Completes the power_state mapping from compute driver and manager

Fixes bug 1166906

Added extra states to constants module together with test
cases checking every state map.

Also added some debug statements under blockdev and operator
to be able to spot obvious issues with images at deploy time.

Change-Id: I77ebb4d417a3875b761f5fb220d9274b79611ff0
baremetal: Change input for sfdisk

To prevent sfdisk stopping with "bad input", use a empty string
instead of "-" (and doing so requires using "," as a separator).

Fixes bug 1166112

Change-Id: I5e4cffaa326fbafd1583d55744f921a40b3ae76f
Allow listing fixed_ips for a given compute host.

nova.db.fixed_ip_get_all_by_instance_host was removed in commit
bb867ce3948ddc23cf928ca3dda100a1a977896a, but was still used in
nova-manage. This patch works around the removal of the foreign
key that led to this method being removed.

Resolves bug 1163660.

Change-Id: Ieccd37c752e245558827615c098604d11ad3d945
Correct disk's over committed size computing error

There's a error in the disk's over committed size computing for the
instance which using RAW type disk. This issue caused
disk_available_least resource counting increasing.

Fixes bug: 1167695

Change-Id: I4e6cf22a9cf66a757e3641e2a0be0b7699cae69d
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Sync rpc from oslo-incubator.

This includes rpc api namespace support, some minor configuration
related fixes, and the redis based matchmaker for use with impl_zmq.

Change-Id: I9fc826a498461417afe8b2a923edac8d68c2c18f
baremetal: VirtualPowerDriver uses mac addresses in bm_interfaces

After the change I6653829364b0a641442d45e766493180d6f2a880,
bm_nodes.prov_mac_address is no longer set. However VPD still
uses it. This patch changes VPD to use bm_interfaces.address
instead of bm_nodes.prov_mac_address.

Fixes bug 1168574.

Change-Id: I2bab869b282958ee9fd0e4776928e56351018324
Remove orphaned db method instance_test_and_set

Commit 86544fad81f95b74407a76bea8b081f490e2832f removed the only use
of this method together with the sqlalchemy implementation of it but
forgot to remove it from db.api.

Change-Id: I751f99ee64cdeab56f1f3fd9f846157f241804a2
Import and convert to oslo loopingcall.

Import the oslo looping call implementation (which is a copy of
nova's), delete nova's local copy, convert all users to the new
location.

It should be noted that the oslo implementation of
FixedIntervalLoopingCall measures time from the start of the
periodic task, not the end, so periodic tasks will run with a
constant frequency instead of the frequency changing depending on
how long the periodic task takes to run.

Change-Id: Ia62ce1988f5373c09146efa6b3b1d1dc094d50c4
Cleanup and test volume usage on volume detach

* Refactor _poll_volume_usage to be more readable

* Test that detaching a volume updates the totals on the volume usage
  cache correctly. This works but adding test to make sure that it always
  works.

Change-Id: I82da44137bc65d5f04bca0820eb327438d6e1f35
Merge "xenapi: Make _connect_volume exc handler eventlet safe"
Added comments to quantum api client

Added a few comments for bug 1020184

Change-Id: I6bc59b5b8b57685aae461e5b1111d8dbd168123d
hypervisor tests more accurate db

The hypervisor tests don't accurately model the db because the
sqlalchemy DB API requires admin for the compute_node_get_all
function.

This change makes it so that the fake compute_node_get_all
function in the hypervisor test module requires admin just like the
sqlalchemy DB function.

Change-Id: I5acd45cfbd10ec06d8c5a9425e9c6ed18cff669e
Translate cinder NotFound exception

When we attempt to get information about a snapshot
which doesn't exist we get a cinder NotFound exception.
However, this is not caught and causes a stacktrace in the logs.
This occurs on every tempest run in the test
EC2VolumesTest.test_create_volume_from_snapshot.

The fix is to translate the exception to SnapshotNotFound
which is handled correctly further up the call chain.

Fixes bug 1169777

Part of blueprint no-stacktraces-in-logs

Change-Id: If893b5083b93894e671c978bd23bd89d3d017531
removing unused variable from a test

Change-Id: I4b5613ae756bac794f82dec4abfa1361efac4054
Merge "Fix bug in os-availability-zone extension."