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
Hyper-V: Skip logging out in-use targets

As most of the Cinder volume drivers that use iSCSI export one LUN
per iSCSI target, the Hyper-V driver was logging out the according
target each time a volume was disconnected.

This causes issues with some volume drivers that use multiple LUNs
per iSCSI target and may disconnect in-use targets.

This patch fixes the issue by checking if there are other LUNs
being used, disconnecting the iSCSI targets otherwise.

Change-Id: Ida08e7129a7b7940ddea488488cccc7571a43b76
Closes-Bug: #1372815
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
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
Remove admin context which is not needed.

_get_guest_config use admin context to read deleted flavor, it's
not needed because flavor function in db layer didn't require that.

Change-Id: Idbf6a7d712d432da5a5919c28e988870ead0d4b2
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
Make console show and delete exception msg better

Console API show and delete didn't give info about
the detailed fail information, this patch adds it.

Change-Id: Icc4ed506590b4f3d2f85160a19ae3b70d8cdf1ab
maint:Don't translate debug level logs

Our translation policy
(https://wiki.openstack.org/wiki/LoggingStandards#Log_Translation) calls
for not translating debug level logs. This helps to prioritize log
translation.
There were some commits that fixed it but ignored the the style like
msg = _('this is debug info'); LOG.debug(msg)
This commit fixes this style of LOG.debug.

Change-Id: I2cc3fe563456ba0906f74262ab1ba6967301d6d1
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
Fixed typos in nova.objects.base docstrings

Change-Id: I1d485a2ca2fca58262bc023e5c9f273c6632e4a6
Merge "VMware: use instance.uuid instead of instance['uuid']"
Merge "host manager: Log the host generating the warning"