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
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
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
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
Map internal S3 image state to EC2 API values

Fixes the EC2 API so it maps internal S3 image state values to
ones defined by the EC2 API rather than returning the internally
used values.

Fixes bug #1074904

Change-Id: Iabbda0e5fcbe4d572c76367c6f98d4bece050e73
Delete extra space to api/volumes message

Change-Id: I04efa9c8ddb5790f99d66c302198bf92000f6e66
Signed-off-by: You Ji <jiyou09@gmail.com>
Fix up regression tester

* Clean up to support pydoc
* Support -h
* Make it actually work
* Improve docstrings
* Add copyright

Change-Id: I977df71e8213e39e9eebf9cc56b2dd7625959870
Translate NoMoreFloatingIps exception

When the pool of floating ips is exhausted the NoMoreFloatingIps exception
is raised but not handled properly in the floating ips extension resulting
in the exception propagating further up and causing a stack trace to be logged.

This change translates the exception explicitly into a HTTPNotFound, preserving the current
REST API behaviour. It fixes a bug where the pool name was not correctly inserted into
the message returned if allocation from a specific pool was requested.

Fixes bug 1169811

Part of blueprint no-stacktraces-in-logs

Change-Id: I8f35d25d065bb1fa709cff6f59841ac8c86658bd
Update the log module from oslo-incubator

Contains fix to stop the logger system from logging events twice.

Also includes PID in default logging_context_format_string

Fixes bug: 1170049

Change-Id: I007786604138c41fbcf1127c01339132c56a6aab
Remove unnecessary full resource audits at the end of resizes

Both confirm_resize and revert_resize ends with full resource audits
which is unnecessary, given that correct calculations can be made
using existing claims.

Resolves bug 1169982.

Change-Id: If0f91651605a95e73fdbf88aa18c279bfaf73b04
Fix ec2 CreateVolumes/DescribeVolumes status

In admin context CreateVolumes/DescribeVolumes returns
extraneous information such as project_id, host, instance
data etc. This results in output which is not compatible
with the ec2 API. This change removes the addition
of the extra information.

This only partially fixes bug #1074901 as mapping the internal
volume states to ones specified by the ec2 api results in the devstack
euca.sh exercises to fail. But that can't be fixed until the fix
in this patch is through as the extraneous information returned by DescribeVolumes
causes euca-describe-volumes to not to show the attachment state for
a volume which is needed by the euca exercises.

Change-Id: I48a96fbfe4bb2e3da9514d688638ecdf3a168303