cinder os-force_detach action api 202 accepted even if required "connector" parameter is not passed in request body

Bug #1619647 reported by Bhagyashri Shewale
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Low
luqitao

Bug Description

In case of "lvm" backend if user does not passed "connector" parameter in the request body of "os-force_detach" action api then it returns the 202 accepted but as per the api-ref document [1] "connector" is the mandatory parameter, so in this case it should return 400 BadRequest.

Input:

curl -g -i -X POST http://172.26.88.24:8776/v2/5616418a7be141c3a701791540703f55/volumes/65f02c4d-d46c-43d5-a7ee-00b9c33dfa9a/action -H "User-Agent: python-cinderclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: a2cdc6a42c198c4fa0a7a453d85c4894dc97df76" -d '{"os-force_detach": {}}'

OutPut:

HTTP/1.1 202 Accepted
Content-Type: text/html; charset=UTF-8
Content-Length: 0
X-Openstack-Request-Id: req-e345b370-ed9a-4c37-a7c7-54ea325f0769
Date: Fri, 02 Sep 2016 09:12:54 GMT

[1] http://developer.openstack.org/api-ref-blockstorage-v2.html

Tags: bugsmash
Changed in cinder:
assignee: nobody → Bhagyashri Shewale (bhagyashri-shewale)
Changed in cinder:
importance: Undecided → Low
Jay Bryant (jsbryant)
tags: added: bugsmash
Revision history for this message
luqitao (qtlu) wrote :

This bug has been fixed in master branch

Changed in cinder:
status: New → Invalid
Revision history for this message
Gorka Eguileor (gorka) wrote :

It is not actually fixed in master even though the try...except may make us think so.

Changed in cinder:
status: Invalid → New
Revision history for this message
Scott DAngelo (scott-dangelo) wrote :

Is this a bug in the code or a bug in the api reference?
One of the purposes of force-detach is to help the admin clean up if things are in a bad state, so there might not be a connector to pass in. This is the case if Cinder thinks the volume is attached but the Nova instance has already been deleted.
The fix for this should probably be to correct the api-reference.

luqitao (qtlu)
Changed in cinder:
assignee: Bhagyashri Shewale (bhagyashri-shewale) → luqitao (qtlu)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/466165

Changed in cinder:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/466165
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=00edd490c6789f16d6eb5c4952308c9f5131b8eb
Submitter: Jenkins
Branch: master

commit 00edd490c6789f16d6eb5c4952308c9f5131b8eb
Author: luqitao <email address hidden>
Date: Thu May 18 23:10:01 2017 -0400

    Make "connector" param to be optional in force-detach api

    One of the purposes of force-detach is to help the admin clean up
    if things are in a bad state, so there might not be a connector to
    pass in. This is the case if Cinder thinks the volume is attached
    but the Nova instance has already been deleted.

    Change-Id: I417ed7b100dfe8402599028597511949e00725ac
    Closes-Bug: #1619647

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 11.0.0.0b2

This issue was fixed in the openstack/cinder 11.0.0.0b2 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.