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
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 "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()"