Remove unused network_api.get_instance_uuids_by_ip_filter()

Last usage was removed in ae781ee97947c33d6d43e4c21df4f338c875bf1c

Change-Id: I33dc14085ca0c887778c7379f0498714e8d30425
VMware: make use of oslo.vmware pbm_wsdl_loc_set

Make use of the oslo.vmware method for setting a defined wsdl.

Change-Id: I207f0e737139c06c5b1ea9019cfbf4659aa5ca1a
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
hardware: add method to return requested memory page size

Introduces method to return requested memory pages size.
This commit also add a new exceptions MemoryPageSizeInvalid and
MemoryPageSizeForbidden

Work-Item: Enhance libvirt driver to configure guests based on
           the flavour parameter for page sizes

Partial-Implement: blueprint virt-driver-large-pages
Change-Id: I94e63159ee5539ed7b947614ff0ec87182f184a4
Handle invalid sort keys/dirs gracefully

If an invalid sort key or sort direction is supplied on a GET servers
REST API call, the API returns an error code 500 with the "The server
has either erred or is incapable of performing the requested
operation." message.

This is occurring because the exceptions raised in
oslo.db.sqlalchemy.utils.paginate_query are not caught and handled in
nova.

paginate_query raises oslo.db.exception.InvalidSortKey for an invalid
sort key and raises a ValueError for an invalid sort direction.

Change-Id: I42ceaa461ddbf33dde44355d0cb0fb752c361f2f
Closes-Bug: 1403230
Add pci_device_pools to ComputeNode object

The compute_nodes table has a field called pci_stats
that is used to pass pci device availability to the
scheduler. The pci device data is obtained by the virt
drivers and passed to the resource tracker in the available
resource data. The resource tracker creates pci device pools
to track the number of similar devices as a resource.

The pci_stats field contains the pci pool data.

A new object versioned called PciDevicePool has been created
for the pci device pool data. The pci_device_pools field is added
to the ComputeNode object as a PciDevicePoolList object.
The type of the field is:

    ObjectField('PciDevicePoolList')

The format that the PciDevicePool object uses to store data in the
database is made backward compatible with the existing format.

There was an alternative patch by yjiang5 that does not version
the data in the field, this patch replaces that one. The original
can be found here Ifde89b209f2fcc2283894195b1e7e866cf28dccb

Co-Authored-By: Paul Murray <pmurray@hp.com>
Co-Authored-By: yunhong-jiang <yunhong-jiang@intel.com>
Co-Authored-By: Ed Leafe <ed@leafe.com>

Change-Id: I625f13061fddfb0cdb16c8e36336656b40696447
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"