Make test_evacuate from compute API DRYer

test_evacute creates a context in almost every test
and sets its properties. Move that to a method to avoid extra
copy/paste.

Change-Id: Ib75575061bddf2546c46a6ef788ab85b5926ce69
Fix monkey_patch docstring bug

Modify Flags.monkey_patch to CONF.monkey_patch

Change-Id: I773a94d97d206bf78ac52de8e22d9e6db7650eb9
Closes-Bug: #1258048
Rename instance_type to flavor in vmware virt driver tests

Renames 'instance_type' to 'flavor' in the vmware virt driver tests.
There were no occurrences of 'instance_type' in the virt driver itself,
so this patch only changes the tests.

Part of blueprint flavor-instance-type-dedup

Change-Id: I81ea543e0ab480e35cf5b7b59bd9ecb1cf361c6f
Rename instance_type to flavor in libvirt virt driver tests

Renames 'instance_type' to 'flavor' in the libvirt virt driver tests.
There were no occurrences of 'instance_type' in the virt driver itself,
so this patch only changes the tests.

This also removes the unused _create_instance_type method in
test_libvirt.

Note that instance_type_id and instance_type_swap are not changed since
those are part of the database model and would require a database
migration to change them.

Part of blueprint flavor-instance-type-dedup

Change-Id: Iec71509e38aed1341f37194fb94dd34b10ac2f54
VMware: fix rescue with disks are not hot-addable

Some disks, for example IDE, cannot be attached to an instance
when the instance is running.

Change-Id: I3360066ea6406564caa328ec052b9e3ca9d63dc6
Closes-Bug: #1247556
Set objects indirection API in network service

We need to set the
nova.objects.baseNovaObject.indirection_api global inside the network
service to point to the conductor API so that the object actions will
 be done by RPC to conductor.

Part of blueprint: nova-network-objects

Change-Id: I9e2c643eae7d09f5037485386e6ea53b75587980
Add VirtualInterface object

Add new objects: VirtualInterface and VirtualInterfaceList.  These are
needed for converting nova-network over to use objects.

Part of blueprint nova-network-objects

Change-Id: Idab38a2a9bd8737fcc8e112759c539b7ebad4df9
Sync module units from oslo

Module units landed in Nova first, then was accepted by oslo with
minor changes. This patch removes nova specific unit module and
test, replaces with module units in oslo.

commit in Oslo:'Add unit constants' f9308560c36918cc

Change-Id: I6054c18a56f59d33a69f4714be19d34fbe9de335
Co-Authored-By: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@cloudwatt.com>
Nova Docker driver must remove network namespace

The docker hypervisor creates for each container a network
namespace which represents the nova network. This network
namespace must be removed/destroyed when nova instance will
be destroyed in order to cleanup the machine properly.

Change-Id: I6fa306d06fb16f8ceddb06e22566974237082759
Closes-Bug: 1261007
Add instance faults during live_migrate errors

When there is an error in the compute manager relating to
live-migrate, this change ensures that an instance fault is
recorded to help debug any issues.

We also need to look at better reporting of errors to users,
but this is not in the scope of this small change.

Change-Id: Ib4f0d0aea64468a4a1495b0318fc531a7d0d4eaa
Make test_different_fname_concurrency less racy

This test case makes a bad assumption about when a greenthread will run
and signal its done event.  The test code yields once using a sleep and
expects that the done event will get signaled before the test code runs
again.  This may not be the case.  Instead, yield up to 10 times waiting
for the done event to occur.

I was not able to reproduce this failure locally, but we're seeing it
regularly in CI.  It seems that this should resolve it.

Change-Id: I978ae9eef5bb1ac296055dc1613406e4284a625f
Closes-bug: #1270654
Create common method for MTU treatment

MTU setting for device was repeated a number of times in the code.
The patch set creates a common function to do this operation.

Change-Id: I5aea4eb02302d7396ae104bee906bf1c37239542
Sync processutils from oslo-incubator

This includes the following changes:

  af41592 Catch OSError in processutils
  f773ea2 Fix i18n problem in processutils module
  8b2b0b7 Use hacking import_exceptions for gettextutils._
  3b71f46 Fixed misspellings of common words
  12bcdb7 Remove vim header
  a4dab73 Correct execute() to check 0 in check_exit_code

Closes-bug: #1271331
Change-Id: I12b621fa5a2cdeeab6d51902416ce5dd4db61ba7
Re-write sqlite BigInteger mapping test

This test makes sure that our hook that compiles BigInteger() into
INTEGER for sqlite instead of BIGINT is working as we expect.
Unfortunately, we've seen some problems running the sqlite command to
check the schema.

This patch rewrites the test to only use sqlalchemy APIs and avoid
calling out to the sqlite command for verification.

Change-Id: Id3964d0dd5b0ddf08ab745d6878840ff06b2f0dd
Closes-bug: #1271331
Make test_poll_volume_usage_with_data more reliable

This test includes 2 calls to time.time().  It assumes that the result
from the second call may be greater than the first.  This isn't
definietly true and we see periodic failures of this test in the gate as
a result.

Change the test to not worry about the specific time value that gets
set.  We set _last_vol_usage_poll to 0 before calling the function under
test.  We really only need to check that it got set to some value after
calling the function under test.  This tweak should make the test pass
consistently.

Change-Id: I6c01d2958cf671c29622562689a15ca1ddea0a3c
Closes-bug: #1270693
Merge "Re-write sqlite BigInteger mapping test"
Merge "Make test_poll_volume_usage_with_data more reliable"
Merge "Add instance faults during live_migrate errors"
Merge "Nova Docker driver must remove network namespace"
Merge "Add VirtualInterface object"