← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1871598] Re: PUT /servers/{server_id}/os-volume_attachments/{volume_id} does not update delete_on_termination from True to False

 

Reviewed:  https://review.opendev.org/718387
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=98fbff8b4c7eb2c62c74f28bb344a09094729212
Submitter: Zuul
Branch:    master

commit 98fbff8b4c7eb2c62c74f28bb344a09094729212
Author: zhangbailin <zhangbailin@xxxxxxxxxx>
Date:   Wed Apr 8 18:50:02 2020 +0800

    Convert delete_on_termination from string to boolean
    
    In volume update API we can update the 'delete_on_termination' since
    microversion 2.85. The schema enforced "'delete_on_termination':
    parameter_types.boolean" that field value is a boolean like string,
    but we donot covert from string to boolean before update the
    attachment's bdm, see [1] (it is also commented in bug 1871598.).
    
    [1]http://paste.openstack.org/show/791792/
    
    This commit fix this issue, convert 'delete_on_termination' from string
    to boolean before updating the bdm.
    
    Closes-Bug: #1871598
    
    Change-Id: Ied75efd46336917150f80be2db10f674575826ba


** Changed in: nova
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1871598

Title:
  PUT /servers/{server_id}/os-volume_attachments/{volume_id} does not
  update delete_on_termination from True to False

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  Nova API code does not update delete_on_termination field from True to
  False with a PUT /servers/{server_id}/os-
  volume_attachments/{volume_id} request. Since microversion 2.85 False
  -> True update works but not the other way around.

  The schema enforces that the field value is a boolean like string[1],
  but the code does not convert from string to boolean before setting
  the bdm field at [2]. This causes that the sting is coerced to boolean
  by the OVO boolean field but that considers any non empty string as
  True.

  [1]https://github.com/openstack/nova/blob/e5cd0fdd870154ee6aefdf9494c69bba75394e00/nova/api/openstack/compute/schemas/volumes.py#L115
  [2]https://github.com/openstack/nova/blob/e5cd0fdd870154ee6aefdf9494c69bba75394e00/nova/api/openstack/compute/volumes.py#L455

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1871598/+subscriptions


References