Add API schema for v2.1 block_device_mapping extension

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 v2-on-v3-api

Change-Id: I6d53ef2e3dad5a4ac9b67a5838f6e07606a8372b
objects: allow creation of objects without dict item compat

The dict compat support in NovaObject is useful for incrementally
converting existing code over to use objects. Any brand new objects
though have no reason to support dictionary access, so there should
be a way to disable this compat mode.

This moves all the dict compat support methods out of NovaObject,
to a new class NovaObjectDictCompat. All existing objects are
updated to add this new class as a mix-in parent.

In future any completely new objects (ie ones which aren't being
used to converted existing code from dict instances) should avoid
inheriting from NovaObjectDictCompat. Existing objects should
also have this parent class removed once all callers are audited
and/or updated to ensure they do not require dict compat.

Change-Id: I03f93f0c40df6f5f7df9cefe28dff900c22294c9
objects: stop conductor manager using dict field access on objects

The conductor manager 'object_action' method was accessing object
fields using dict syntax instead of attribute syntax. This meant
that every single object would always have to support dict compat
mode.

Change-Id: I7431b5d8e889eebacfef9179c9dceab54ac286ca
objects: remove dict compat support from all XXXList() objects

The XXXList() classes only ever have a single 'objects' attribute
and this is never directly accessed as a dict key, instead all
callers use it in list context. Thus the dict compat support can
be removed from all these objects

Change-Id: I3f8d49d25b99dd0a498dfaad705c6332908cb72f
Use oslo db concurrency to generate nova.conf.sample

Make sure we include database and concurrency options in the
sample config file.

Change-Id: I66e68ec120cba2cee86e36aa26720199876c40a4
Closes-Bug: #1391782
Reject non existent mock assert calls

assert_called and assert_not_called are not asserting the state
of the mock object but considered as mocked calls so mock
will never raise exception but always executed successfully

This change patches the Mock class during unit test
to raise an exception if a function called on a mock object
that's name starts with 'assert' and does not one
of the supported Mock assert calls.

This change also fix the unit test to call only the supported
assert function on mock object.

This change also removes hacking rule N327 as the mock change
renders this hacking rule obsolete.

Change-Id: Id75def84bd4bdc1c1fb06221b4223322a99251eb
libvirt: move setting of clock out into helper method

Move clock settings will be added in the future, so it
makes sense to have a separate helper method for all
of them.

Related-bug: #1400315
Change-Id: I1662e2d1e2e729da873c14a0cc307e412c699320
Adds support for versioned schema validation for microversions api

Adds the ability to specify minimum and maximum API microversion
versions on jsonschema validation decorators. Validation will
only occur through the decorator if the incoming request version
matches the version range specified. If no range is specified then
validation will always occur.

Partially implements blueprint api-microversions

Change-Id: Ia71963161966af3ca0e6e30e2245f12120f8f8d1
Imported Translations from Transifex

For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: Ie30bed8cad51c384e7539dbe9fc945d5aed3ada6
Fix set_vm_state_and_notify passing SQLA objects to send_update()

Similar to the fix in https://review.openstack.org/137194, with the
recent changes to notifications this must now pass an instance object.

Change-Id: I37431dd14165883d9a4f81c3892bd6c3a94da86d
Related-Bug: #1396324
Replace use of handle_schedule_error() with set_vm_state_and_notify()

Conductor task build_instances() currently uses error handling code in
scheduler driver to set instance error state and issue notifications.
There is a similar method in scheduler utils that does the exact same,
which a prior change converted to correctly send instance objects to
notifications send_update().

This in additon has the added benefit of decoupling conductor from
scheduler driver internals.

Change-Id: Iad9ecf99734fb4c200ba046da42128299a1162f2
Related-Bug: #1396324
Merge "objects: allow creation of objects without dict item compat"
Merge "objects: stop conductor manager using dict field access on objects"
Merge "objects: remove dict compat support from all XXXList() objects"
Merge "Reject non existent mock assert calls"
Merge "Imported Translations from Transifex"
Merge "Use oslo db concurrency to generate nova.conf.sample"
Merge "Adds support for versioned schema validation for microversions api"
Merge "libvirt: move setting of clock out into helper method"
Merge "Add API schema for v2.1 block_device_mapping extension"