Don't mask out HostState details in WeighedHost

WeighedHost's __repr__ was poking under the HostState hood to use
.host in its own __repr__ but this hides some important details.
Specifically it hides the hypervisor_hostname, which is important for
Ironic as one 'node' can have thousands of hostnames. The other
details such as available RAM and so on are also useful for ops trying
to debug scheduling issues, so rather than add hypervisor_hostname, I
am just delegating to the underlying __repr__.

Change-Id: I79e55c32b3d0768430132275ebe050f38c63bc87
Add extensible resources to resource tracker (2)

A resource plugin extension point is added to the resource
tracker to allow the types of resources allocated at the compute
node to be extensible. Information maintained by these plug-ins
is written to the compute_nodes table in the database. The
scheduler uses the information in the compute_nodes table to
determine scheduling decisions.

A plugin that implements vcpu resource tracking is included
and all other code for tracking vcpu has been removed. This
example ensures the plugins are tested in gate jobs.

This was previously merged and reverted due to a bug affecting
ironic CI. The bug was pre-existing but was exposed by the
that patch. This change is based on the bug fix here:
Icb19148660bca542a8120ecab064551d67ac28af and the previous
version of this change is here:
I64108338e3c958ba1276aaf113a68861cbe286f5

Co-Authored-By: Andrea Rosa  <andrea.rosa@hp.com>
Co-Authored-By: Paul Murray  <pmurray@hp.com>
This is part of: blueprint extensible-resource-tracking

Change-Id: If1381f99fd7db420380288faf7b2f57553f69136
Make network/api.py use Network object for associations

This makes the network/api.py module use the Network object for
network host and project associate/disassociate operations. There
was very little testing of this, so this patch adds/corrects tests
to verify object behavior.

Related to blueprint compute-manager-objects-juno

Change-Id: I5c0d61be35fc4edf647e572c746515988651bcc0
Fixes wrong usage of mock.assert_not_called()

There is no method assert_not_called in mock, use
assertFalse(mock.called) instead of that.

Change-Id: I846c37fe79931c85384950f6ad6ecd79d4071fec
Optimize db.floating_ip_deallocate

'select for update' and 'update' operations
were combined into a single 'update' operation

problems with 'select for update' relate to
spec https://review.openstack.org/#/c/97310/1

now 'floating_ip_deallocate' function returns
number of updated rows in db

Partial-Bug: #1343613

Change-Id: I60f5a8f3e1541983dea1589783927107c00c5fa4
Merge "Make network/api.py use Network object for associations"
Merge "Don't mask out HostState details in WeighedHost"
Merge "Fixes wrong usage of mock.assert_not_called()"
Merge "Optimize db.floating_ip_deallocate"
Merge "Add extensible resources to resource tracker (2)"