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
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"
Merge "Split agg image props isolation filter unit tests"
Merge "Split out agg multitenancy isolation unit tests"
Merge "libvirt: fully parse PCI vendor/product IDs to integer data type"
Merge "Reduce the complexity of stub_out_db_network_api()"