Fixed comment typo

Change-Id: I68dd463c7365b536396c6715efa6042b3f102670
Fix init_host checking moved instances

Commit 6fc00d3465185 (https://review.openstack.org/#/c/18486/)
introduced a couple of problems.

1) It introduced a method to try to deduce instance integer id from
   a name the driver reports and using instance_name_template.  This
   fails badly when you're using something like 'instance-%(uuid)s' for
   instance_name_template.  It's only used when the driver does not
   support the 'list_instance_uuids' method.. but XenAPI happens to
   not implement this method.

2) There's a call to _get_instance_volume_block_device_info() that is
   passing an instance_uuid when the method wants an instance.

Fixes bug 1097987 (#1 above) by doing a brute force match against
   all instances' names.
Fixes bug 1097978 (#2 above)

Change-Id: I2da7658dd906fa06f0e867a2b22bf14e7f34cb12
Update instance's cell_name in API cell.

It was accidentally being removed before updating the DB due to code
being moved and not updated.  The test for the method was broken, too,
allowing this bug to sneak in.

Fixes bug 1098093

Change-Id: I05c00b8b100568b39afb8ee0ca7ee94d4dd97c0a
Remove bogus 'unplug' calls from libvirt VIF test

Since the 'get_config' method was introduced to the libvirt
VIF class, separate from the 'plug' method, there is no need
to call the 'unplug' method in the test suite

Blueprint: libvirt-vif-driver
Change-Id: I1c3d055e258117c2657cd72386472dff2e0e08b8
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add host name to log message for _local_delete

Better log message will hopefully make it easier for operators
to diagnose.

Change-Id: I447f7530a05f9af6e152f1e5d484027684795b27
fix new N402 errors

fix the N402 errors that have slipped in in the last 48 hrs since
starting this patch series.

fix an N401 error that our scanner current can't find because it
only looks for doc strings on classes and defs.

this is the xeno's paradox of patch series, but we're getting close.

Change-Id: I4a763bb4c812335d853eae05c72464f18ab93297
make runtests -p act more like tox

now that all the N402 fixes are in, start enforcing it

Change-Id: I9d495849bf698e5af142d0ccafe551ac0e8a600c
Merge "Fix init_host checking moved instances"
Merge "Fixed comment typo"
Add user/tenant shim to RequestContext

This is necessary because we pass the Nova context object to
openstack-common/code (logging, for example), which expects the
attributes to be named user/tenant not user_id/project_id.

Fixes bug 1098278

Change-Id: Ic0dc49ef54515fc0ffaa0895cf4d88701afb1e16
Cleanup pyflakes in nova-manage

Also fixes bug 1097830

Change-Id: Id0d73950709b92f39b7ab7a915373ace0b1616ae
Merge "fix new N402 errors"
Merge "make runtests -p act more like tox"
Merge "Add user/tenant shim to RequestContext"
Merge "Update instance's cell_name in API cell."
Change ComputerDriver.legacy_nwinfo to raise by default.

This makes non-updated hypervisors visible by grepping for 'def
legacy_nwinfo' rather than only the updated ones being visible, and
when new hypervisors are added, it will be clear whether they use the
legacy format or not.

Out of tree hypervisors will be broken by this, but the fix is
trivial::

def legacy_nwinfo(self):
    # XXX TODO Update to use the non-legacy format.
    return True

Change-Id: If5b461bc5d8e8dc21de3ca9cf521e7b341724900
Move update_instance_info_cache to conductor.

The network API always updates the instance_info_caches table whenever
someone asks for current network information for an instance.  When
the compute manager calls network_api.get_instance_nw_info(), we'll need
to use the conductor for the cache update instead of a local DB call.

Adds an option to network_api's get_instance_nw_info() to not update the
cache and adds code into compute manager to update the cache via the
conductor.

Related to blueprint no-db-compute-manager

Change-Id: I36c3eb5b4e31ef2e26d3023bf2521d95205eb6ac
Create a directory for servicegroup drivers.

Right now there is only one servicegroup driver, the db backed driver.
Create a directory for drivers to reside in to keep things a bit more
tidy as we add additional drivers.

Part of blueprint rpc-based-servicegroup-driver.

Change-Id: Ib563e1a8d184cef838e5730b2fc6904940d04c21
Move logic from os-api-host into compute

Renames host to host_name in various places to make it explicit what it
is the APIs are accepting and what we are passing around.

Moves logic out of the openstack api's host extension to the compute
library. This is in preparation for cells; cells provides its own
compute library that proxies certain calls to child cells.

In an effort to separate out the layers of code, we're moving all DB
related logic out of the openstack api layer and into compute library
layer.

For example @check_host which calls the DB should not be in the openstack
api layer. In the case of cells, we can't check for the existence of the
host until we arrive at the cell that contains the host.

Implements: blueprint host-api-prep-for-cells
Change-Id: Icb861fd323ba707ab3b661f0a2c6d8bb7bfdc85e
Access instance as dict, not object in xenapi

get_all_bw_counters() in XenAPI was accessing instances as objects
instead of dicts.

Fixes bug 1098382

Change-Id: I9a783c0f403b60d392dc26a25b93683e7c145600