Add API schema for v2.1/v3 flavors_extraspecs API

By defining the API schema, it is possible to separate the validation
code from the API method. The API method can be more simple.
In addition, a response of API validation error can be consistent for
the whole Nova API.

Partially implements blueprint v3-api-schema

Change-Id: I71f89b59dd4e542d2befa971182cc587b6fec269
Move rebuild to conductor and add find host logic

[*] Move rebuild instance to conductor task api will help
    in consolidating the logic for both evacuate instance and
    rebuild instance. Rebuild instance and evacuate instance
    uses the conductor task api for rebuild instance workflow.
[*] Add logic required to support rebuild without host.
    (used by evacuate)
[*] Refactor rebuild action to pass the instance host as argument,
    instead of None.

Evacuate and Rebuild will behave the same way as today.
Modifications for the new feature in API will be implemented in
new patches.

Partial Implements: blueprint find-host-and-evacuate-instance

Change-Id: I4b1a9c2227574db7179441d531a49145f213ea87
Co-Authored-By: Juan M. Olle <juan.m.olle@intel.com>
Co-Authored-By: Anuj Mathur <anujm@thoughtworks.com>
Co-Authored-By: Navneet Kumar <navneetk@thoughtworks.com>
Co-Authored-By: Claxton Correya <claxton@gmail.com>
Mask node.session.auth.password in volume.py _run_iscsiadm debug logs

The iscsi_command object passed to _run_iscsiadm can contain passwords
that get logged at debug level, so we need to sanitize the message
getting logged.

Adds a test to ensure the logged message is properly sanitized.

Closes-Bug: #1320028

Change-Id: I33f1a5b698368504721b41e56266162a713b3ce6
libvirt: Save device_path in connection_info when booting from volume

If you boot an instance from a volume and later terminate it, the
libvirt volume driver disconnect_volume method does not have the
'device_path' key in connection_info['data'].  However, if you
attach a volume to an existing instance and then detach it,
the disconnect_volume method would have the 'device_path' key in
connection_info['data'].  Having the 'device_path' key would be
useful for some volume drivers to determine the device path of the
volume.  This patch saves the 'device_path' in connection_info['data']
when _create_domain_and_network is called, so it could be later used.

Change-Id: I8ebb5f3c2e7a81b11d776f8c0a15f3491ed273be
Closes-Bug: #1291007
Change compute updates from periodic to on demand

Currently, all compute nodes update status info in the DB on a periodic
basis (the period is currently 60 seconds). Given that the status of
the node only changes at specific points (mainly image
creation/destruction) this leads to significant DB overhead on a large
system. This BP changes the update mechanism to only update the DB when
a node state changes by keeping an old copy of the state info and
only updating the DB if the new state info is different.

Docimpact - check to see if there's a documentation impact to this change.

Change-Id: I19c174488b61977358a4d617cc4b590e317e665a
Implements: blueprint on-demand-compute-update
update ignore list for pep8

Remove H803 as Nova does not run into that issue. Sort
the rest of the items (E129 was out of place).

Change-Id: I6c2537dd27c947e36ebf37eb3b5c8a1ab8b026a1
Use oslo.i18n

oslo.i18n provides the i18n functions that were provided by
oslo-incubator's gettextutils module. Some tests that were
using internal details of the library were removed.

Change-Id: I44cfd5552e0dd86af21073419d31622f5fdb28e0
Merge "libvirt: Save device_path in connection_info when booting from volume"
Merge "Move rebuild to conductor and add find host logic"
Merge "update ignore list for pep8"
Merge "Add API schema for v2.1/v3 flavors_extraspecs API"
Merge "Change compute updates from periodic to on demand"
Merge "Use oslo.i18n"
Merge "Mask node.session.auth.password in volume.py _run_iscsiadm debug logs"