nova/nova/tests/unit/api/openstack
Matt Riedemann dce8618166 Allow None for block_device_mapping_v2.boot_index
The legacy v2 API allowed None for the boot_index [1]. It
allowed this implicitly because the API code would convert
the block_device_mapping_v2 dict from the request into a
BlockDeviceMapping object, which has a boot_index field that
is nullable (allows None).

The API reference documentation [2] also says:

"To disable a device from booting, set the boot index
to a negative value or use the default boot index value,
which is None."

It appears that with the move to v2.1 and request schema
validation, the boot_index schema was erroneously set to
not allow None for a value, which is not backward compatible
with the v2 API behavior.

This change fixes the schema to allow boot_index=None again
and adds a test to show it working.

This should not require a microversion bump since it's fixing
a regression in the v2.1 API which worked in the v2 API and
is already handled throughout Nova's block device code.

Closes-Bug: #1662699

[1] https://github.com/openstack/nova/blob/13.0.0/nova/compute/api.py#L1268
[2] http://developer.openstack.org/api-ref/compute/#create-server

Change-Id: Ice78a0982bcce491f0c9690903ed2c6b6aaab1be
(cherry picked from commit e34f05edb2)
(cherry picked from commit ff1925ae47)
2017-02-09 10:33:35 -05:00
..
compute Allow None for block_device_mapping_v2.boot_index 2017-02-09 10:33:35 -05:00
placement Move placement api request logging to middleware 2016-09-05 13:56:51 +00:00
__init__.py
common.py [python3] Webob request body should be bytes 2015-12-28 13:51:29 -05:00
fakes.py Tests: use fakes.HTTPRequest in compute tests 2016-08-24 19:03:54 +03:00
test_api_version_request.py Use assert(Not)Equal instead of assertTrue(A == X) 2016-06-03 16:53:15 +01:00
test_common.py Rework 'limited' and 'get_limit_and_marker' 2016-03-09 11:30:46 +00:00
test_faults.py [Py34] api.openstack.test_faults.TestFaultWrapper 2015-12-10 20:56:42 +00:00
test_legacy_v2_compatible_wrapper.py Trivial-Fix: Fix typos 2016-06-13 06:41:08 +00:00
test_mapper.py [Py34] Enable api.openstack.test_mapper unit test 2015-10-05 18:59:28 +03:00
test_wsgi.py network: handle unauthorized exception from neutron 2016-07-12 08:20:24 -04:00