Replace custom patching in `setUp` on HypervisorsSampleJsonTests

It would be better if we get rid of `setUp` method in 
`HypervisorsSampleJsonTests` in which happens 
patching and replace it on class-mock.

Change-Id: If3758564c4febf2019ecdb4fce972580a562f759
Handle exception better in v2.1 attach_interface

Add more information when exception occurs in attach interface at Nova
v2.1 API layer.
The commit I7402cfc28d4ee7989c7eb054556df57918bbaeee has been merged
for v2.0 API, this patch does the same change for v2.1 API.

Partially implements blueprint v2-on-v3-api

Change-Id: I1b175501e6db48f27a894db2e66e09d31f8b50e2
Remove uncessary instance.save in nova compute

Adjust the code path to remove an uncessary instance.save
function to make the boot performance better.

Change-Id: I9e9ac85912f026b2953c7b283dd51a704a52164c
host manager: Log the host generating the warning

Currently we are logging a warning when there's a discrepancy between
the host's available disk stored in the database and the disk reported
by the compute node, but there's no information about which host
generates that error.

Change-Id: I8d6704fa76f2750e0e986b8399f9fe358b3fad93
Compute: catch more specific exception for _get_instance_nw_info

There are cases when the method _heal_instance_info_cache tries to
update the network cache. The problem here is that the instance no
longer exists. The exception handling was very broad. This adds
treatment for the specific exception.

Change-Id: I04372cec81fde6ef06e9d7f2b59c1e47e15c0905
Closes-bug: #1385246
VMware: use instance.uuid instead of instance['uuid']

Uses an instance object for deletion, port attach and detach.
These methods now receive an instance object instead of a dict.

TrivialFix

Change-Id: I1092d32f5144baac6dfdc919f5e827533c67e6d6
Remove param check for backup type on v2.1 API

The backup type is only used by glance, so nova check it make
no sense; currently we have daily and weekly as only valid param
but someone may add 'monthly' as param. nova should allow it
and delegate the error. This patch removes check on v2.1 API.

Change-Id: I59bbc0f589c8c280eb8cd87aa279898fffaeab7a
Closes-Bug: #1361490
Move group affinity filters tests to own test file

The group affinity filter unit tests remained in the
test_host_filters.py test file. We simply move them to
test_affinity_filters.py in this patch.

Change-Id: Ic10a5ba2875de42f1f83d30e6d9bd982dffc17e4
Make test_host_filters a NoDBTestCase

This is the final patch in the refactoring series. This changes the
test_host_filters.py file to contain just the test of the filter handler
system and cleans up the previously database-creating TestHostFilters
class.

The entire set of host filter unit tests (around 350 of them) now run in
less than 2 seconds, down from over a 45 seconds on my workstation.

Change-Id: I2f2518a08ac3f8c6addcd4055ee4c706c4c92e8e
Move setup_instance_group to conductor

During prework of scheduler split, we identified that
there is a call from setup_instance_group to the Nova object
InstanceGroup. That prevents the scheduler to be split as a
separate project because it would have an external dependency to
a Nova object.
The implementation here is providing the call by the conductor
before the call to select_destinations as this method only
modifies filter_properties for adding group details.

Co-Authored-By: Ed Leafe <ed@leafe.com>

Change-Id: Ib6556c8f6d6e6dcdb65a0bdb1894c66e92b35230
scheduler: Remove assert on the exact number of weighers

Since the weighers code is by design pluggable, downstream packagers may have
added additional weigher classes, causing this assert to fail.

Rather than require downstream maintain a patch against this line, the
proposal is to remove it since the asserts after it are sufficient.

Change-Id: I13765fae188af92a2e729dcd14caf981db01acb4
Make scheduler code use object with good practice

commit 6c32576b move objects definition into object folder directly,
all other modules do not need to import other objects modules.
So current code didn't use good practice of objects usage and this
patch adjusts the code to use objects better.

Change-Id: I256dc9e3a2802a5c54d4d5e38f0b11039c031e96
Use oslo.middleware

Remove outdated code and replace its usages by usages of oslo.middleware
library

Sync latest request_id middleware from oslo-incubator(only to allow
grenade jobs pass)

4ffc4c8 Add middleware.request_id shim for Kilo
4504e4f Remove middleware

Co-Authored-By: Abhishek Chanda <abhishek@cloudscaling.com>
Co-Authored-By: Davanum Srinivas <dims@linux.vnet.ibm.com>

Change-Id: I89ef3df1b8d3b2c6e391d04e89e35f2ee974a3cc
Use sizelimit from oslo.middleware

Module sizelimit in nova and oslo.middleware is the same, so
switch nova to use RequestBodySizalimiter from oslo.middleware
lib

Replace RequestBodySizalimiter and LimitingReader by temporal
aliases of this classes in oslo.middleware due to failures in grenade
jobs. Remove tests for this module

Change-Id: I6296215857c2b16035c9081e13ac4345ed5c420a
Merge "Move group affinity filters tests to own test file"
Merge "VMware: use instance.uuid instead of instance['uuid']"
Merge "host manager: Log the host generating the warning"
Merge "Remove uncessary instance.save in nova compute"
Merge "Remove param check for backup type on v2.1 API"
Merge "Use oslo.middleware"