← Back to team overview

yahoo-eng-team team mailing list archive

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

 

Public bug reported:

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

** Affects: nova
     Importance: Medium
     Assignee: Brin Zhang (zhangbailin)
         Status: Triaged

** Changed in: nova
       Status: New => Triaged

** Changed in: nova
   Importance: Undecided => Medium

-- 
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):
  Triaged

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


Follow ups