commit dce8618166d80dc6cf2854920f6275eee73b8d84
Author: Matt Riedemann <email address hidden>
Date: Tue Feb 7 20:28:13 2017 -0500
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.
Reviewed: https:/ /review. openstack. org/431610 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=dce8618166d 80dc6cf2854920f 6275eee73b8d84
Committed: https:/
Submitter: Jenkins
Branch: stable/newton
commit dce8618166d80dc 6cf2854920f6275 eee73b8d84
Author: Matt Riedemann <email address hidden>
Date: Tue Feb 7 20:28:13 2017 -0500
Allow None for block_device_ mapping_ v2.boot_ index
The legacy v2 API allowed None for the boot_index [1]. It mapping_ v2 dict from the request into a Mapping object, which has a boot_index field that
allowed this implicitly because the API code would convert
the block_device_
BlockDevice
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 developer. openstack. org/api- ref/compute/ #create- server
[2] http://
Change-Id: Ice78a0982bcce4 91f0c9690903ed2 c6b6aaab1be bfdd8e73cca8fa0 2ea6ef2d60) 56690889a6e063e bce1bb7a80)
(cherry picked from commit e34f05edb2efc79
(cherry picked from commit ff1925ae47245f0