nova/nova/api
Matt Riedemann 9b3c4736a3 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)
(cherry picked from commit dce8618166)
2017-02-09 10:56:38 -05:00
..
ec2 Partial revert of ec2 removal patch 2016-02-19 14:34:38 +00:00
metadata Handle keypair not found from metadata server 2016-06-15 15:46:34 -04:00
openstack Allow None for block_device_mapping_v2.boot_index 2017-02-09 10:56:38 -05:00
validation Add validations for volume_size and destination_type 2016-06-06 04:08:07 +00:00
__init__.py Remove unused copyright from nova.api.__init__ 2014-01-10 16:24:50 +08:00
auth.py remove unused pipeline_factory_v3 alias 2015-12-18 08:00:28 -05:00
compute_req_id.py Remove 'v3' from comments in Nova API code 2015-09-14 14:10:58 +00:00
manager.py Remove vi modelines 2014-02-03 14:19:44 +00:00
opts.py servicegroup: remove the zookeeper driver 2016-02-19 20:21:26 -05:00
sizelimit.py Switch to using oslo_* instead of oslo.* 2015-02-06 06:03:10 -05:00
validator.py Fix comment typo 2015-06-23 08:41:43 +10:00