Fix pyflakes issues in integrated tests

Change-Id: I8d483319d0a20a2c8fb7a5e0e22c83048b7399dc
Move libvirt VIF XML config into designer.py

There are a fixed set of sensible XML configurations for
network VIFs. Create some helper methods for configuring
these configurations. Then update the VIF drivers to call
these APIs. The 'designer.py' file will serve as a place
for any policy based XML configuration helpers, as distinct
from config.py which is purely dealing with XML parsing
and formatting

Blueprint: libvirt-vif-driver
Change-Id: I857607c15ed576c65f898df4eb7533505742324b
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add some constants to the network model for drivers to use

Following on from

  commit 85f857e62a5edacbf467c19add6e51565ae3669f
  Author: Gary Kotton <gkotton@redhat.com>
  Date:   Sat Dec 8 08:54:16 2012 +0000

    Add vif_type to the VIF model

add some constants to nova.network.model to enumerate the valid
values for 'vif_type'. Also add a constant for max bridge name
length

Blueprint: libvirt-vif-driver
Change-Id: I47949c06fee732681bf0b547577f22a319d4e408
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Make nova network manager fill in vif_type

Make the Nova network manager impl fill in the 'vif_type' parameter
in the VIF configuration for instances. This is hardcoded to
VIF_TYPE_BRIDGE, since that's all Nova network supports.

Blueprint: libvirt-vif-driver
Change-Id: I46d1f0edc820ccc198e5a5c876ea25644ebedd86
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Make Quantum plugin fill in the 'bridge' name

There is a comment in the quantum driver code that says it
ignores the 'bridge' name field. This is misleading, because
the bridge name is still required by any virt drivers when
configuring VIFs so they know how to connect them.

Currently the libvirt Bridge driver invents a bridge name
based on 'qbr' and network['id'], while the OVS drivers
use the libvirt_ovs_bridge config. Move this logic into
the Quantum driver, renaming the config option to
quantum_ovs_bridge. The config option should go away completely
once Quantum can pass across the name, as it does for vif_type

Blueprint: libvirt-vif-driver
Change-Id: Ib043e1e6af5712ae1d1665cdca2e9fdbc89d4351
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Make it clearer that network.api.API is nova-network specific.

This may save confusion for new folk, as the indirection to rpcapi
isn't intended to be used to plug quantum in - instead the whole API
object is replaced.

Change-Id: Ib3680826b2ab1e18d249f447828fd1ac9e81132f
Use testr setuptools commands.

Replace the embedded shell scripts with setuptools commands provided by
upstream. Cleans up a few warnings that this cause tox to show.

Change-Id: I9eb47142eafb6ed038b358b94984462ca1632542
Merge "Use testr setuptools commands."
Merge "Move libvirt VIF XML config into designer.py"
Merge "Add some constants to the network model for drivers to use"
Merge "Make nova network manager fill in vif_type"
Merge "Make Quantum plugin fill in the 'bridge' name"
Merge "Make it clearer that network.api.API is nova-network specific."
Merge "Fix pyflakes issues in integrated tests"
Fix uses of service_get_all_compute_by_host

There should never be more than 1 service entry for the same topic and
host, however this method returns a list of services.  All callers of
this method except for 1 already account for there being only 1 service
entry for a particular 'compute' host and only use the first entry in the
return list.

This patch renames the DB API call to be 'service_get_by_compute_host'
and returns a single entry.  All uses of the old method are adjusted
accordingly.

Change-Id: I0e0ef62f5d2e71efe756940d9fdd98aa02fef216
More HostAPI() cleanup for cells.

This patch contains further changes needed to support HostAPI() with
cells.  This moves the formatting of hosts API extension responses back
to the extension itself.  Methods for getting service entries have been
added to HostAPI() that can be overriden in a subclass for cells.

Also contains a performance improvement for 'show' in hosts extension.

Change-Id: Ifd8b68ff8d7495f537dff5e01bd3df75c6c5930a
Cells: Add cells API extension

Enables cells-related functionality such as adding neighbor cells,
listing neighbor cells, and showing the capabilities of the local cell.

Implements blueprint nova-compute-cells

DocImpact

Change-Id: Iacc1e68721a7867aeaf233903cbe6d18f09ad96e
Adds cells support for compute HostAPI()

This will allow the hosts API extension to work. Calls to get service
information from the DB are proxied to all cells.

Implements bp/nova-compute-cells

Change-Id: I8137fa64d2578acfc3d2457c231de2b0d69b96d8
Cells: Add cells support to instance_usage_audit_log api extension

This extension normally gets the audit task entries from the local DB,
but with cells this should be grabbed from every cell.

Implements blueprint nova-compute-cells

Change-Id: I9e78c17fcf70f98903d0a26c1de3e2581b8977ad
Cells: Add cells support to hypervisors extension

Adds support to query for information about hosts and hypervisors from
all cells.

Implements blueprint nova-compute-cells

Change-Id: I17ff10e62d2f10b85a557edcc1509ca3b0d15a29