Reduce the complexity of stub_out_db_network_api()

stub_out_db_network_api' is too complex (57)

Running flake8 to check for cyclomatic complexity showed that the test
method stub_out_db_network_api() in the db/fakes.py module had a
complexity of 57. This change refactors the code to reduce that
method's complexity to 2. No functional changes are included.

Change-Id: Ieb77066ba1133eae5c201121d27a970ce040117e
ironic: use instance object for plug_vifs

It will be better if we'll use `instance` like object.

Change-Id: I8af1afc8eb7feafae25e6f14045528d2ceb74cbd
ironic: use instance object for `rebuild`

It will be better if we'll use `instance` like object.

Change-Id: Ib713357bd55ed5db27dbfd1c657479bd2ed5e90d
ironic: use instance object for `get_info`

It will be better if we'll use `instance` like object.

Change-Id: I9e465c1eba9347c2f0ae686de7476b2f0c5bb17f
ironic: use instance object for `_wait_for_active`

It will be better if we'll use `instance` like object.

Change-Id: I9e263cd4f94f25c3902a98e1471f8d093d0b2030
ironic: use instance object for `_add_driver_fields`

It will be better if we'll use `instance` like object.

Change-Id: I81099563a8f76577c2b5c6901d2b0b89b86182a2
libvirt: fully parse PCI vendor/product IDs to integer data type

When parsing node device XML, the PCI vendor/product IDs were left
in their string form, which is unhelpful for later code wishing to
use their raw values. Fully parse them to the integer form instead.

Blueprint: virt-driver-get-available-resources-object
Change-Id: I46b9c33e08122eb7c28601752ecfc652e09175c1
resource-tracker: Begin refactor unit tests

The current unit tests for the resource tracker are in
/nova/tests/compute/test_resource_tracker.py, and they are virtually
impossible to work with, due to a number of things:

 * They rely on a real conductor service being started during
   each test method
 * They rely on database state since they are not NoDBTestCase-derived
 * They use random nested dicts all over the place for fixtures, instead
   of nova.objects where appropriate, making the unit tests very
   difficult to alter along with changes to "objectify" the resource
   tracker.

This patch is the start of a refactoring effort that removes the
database and conductor service calls and replaces them with mocks and
derives the unit test cases from nova.test.NoDBTestCase. This first
patch simply tests the logic of a single important method of the
resource tracker: update_available_resource(). The test methods test the
various code branches that can occur if the compute node has active
instances running on it, no instances running on it, migrations running
on it, and more.

This patch introduces a new test file called test_tracker.py. When all
code paths in the resource tracker have been tested in test_tracker.py,
I will delete the original test_resource_tracker.py and rename
test_tracker.py to test_resource_tracker.py.

Change-Id: I8373203db5f20fc81c47fea2d7fe5f67eadc98b4
blueprint: make-resource-tracker-use-objects
Split agg image props isolation filter unit tests

Breaks out the unit tests for aggregate image properties isolation
filters from test_host_filters.py. In the process, we remove use of the
database and mock out the calls to db.aggregate_metadata_get_by_host(),
which results in the reduction of unit test times.

Change-Id: Ie6742fcb26364684e4a998168d14a7f29e238edb
Split out agg multitenancy isolation unit tests

Breaks out the aggregate multitenancy isolation unit tests from
test_host_filters.py into its own file and refactors them to not have
any database accesses.

Change-Id: I88c4f1918b4e4257da867a8fdbb7a8e21031896f
Switch Nova to use oslo.concurrency

Let's switch to the newly released oslo library for
the processutils and lockutils.

Change-Id: Icf7831261322abd0a6fc5439fe09b1d4cb614cb7
Drop python26 support for Kilo nova

Now that we have stopped running python26 jobs in the gate, remove
python26 from the list of jobs in tox

project-config patch: Ib495467e00e4b6abf2b3c2b9445b51652ba25167

Change-Id: I18262e91c9f5fc2381c6f5b37eb45b5f27aa81db
Use assertRaisesRegexp

Now that we don't support py26 we can use assertRaisesRegexp

Change-Id: If13527bc0f92891ca2afee4c260538ccf9074735
Use py27 version of assertRaisesRegexp

Now that we don't support py26 we can use the built in
assertRaisesRegexp (which takes slightly different parameters).

Change-Id: Icf30a75f353809984bafb202781120d16979f670
Merge "ironic: use instance object for plug_vifs"
Merge "ironic: use instance object for `rebuild`"
Merge "ironic: use instance object for `get_info`"
Merge "ironic: use instance object for `_wait_for_active`"
Merge "ironic: use instance object for `_add_driver_fields`"
Merge "resource-tracker: Begin refactor unit tests"