Neutron - “Update bandwidth limit rule” API on SUCCESS responds with 200 instead of Expected 202

Bug #1942448 reported by Arkady Shtempler
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Unassigned

Bug Description

### Scenario ###
Activate “Update bandwidth limit rule” API with proper values to make it PASS

### Actual Result ###
Received status code is 200 OK

### Expected Result ###
According the Documentation it needs to be 202 Accepted
https://docs.openstack.org/api-ref/network/v2/index.html?expanded=update-bandwidth-limit-rule-detail#update-bandwidth-limit-rule

### Tempest prompt output ###
BUG_200_instead_of_202BUG_200_instead_of_202BUG_200_instead_of_202BUG_200_instead_of_202BUG_200_instead_of_202BUG_200_instead_of_202BUG_200_instead_of_202BUG_200_instead_of_202BUG_200_instead_of_202BUG_200_instead_of_202BUG_200_instead_of_202BUG_200_instead_of_202BUG_200_instead_of_202
2021-09-01 15:21:48.668 529226 INFO tempest.lib.common.rest_client [req-27de559b-db51-433b-b01b-fd27cba24664 ] Request (QoSTest:test_qos_basic_and_update): 200 PUT http://10.0.0.125:9696/v2.0/qos/policies/31e15f98-8b03-4f8b-9a1a-27847ea48971/bandwidth_limit_rules/f17625ab-24c7-46c1-bcd2-0e326c9ac360 0.269s
2021-09-01 15:21:48.668 529226 DEBUG tempest.lib.common.rest_client [req-27de559b-db51-433b-b01b-fd27cba24664 ] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
        Body: {"bandwidth_limit_rule": {"max_kbps": 2000, "max_burst_kbps": 2000}}
    Response - Headers: {'content-type': 'application/json', 'content-length': '137', 'x-openstack-request-id': 'req-27de559b-db51-433b-b01b-fd27cba24664', 'date': 'Wed, 01 Sep 2021 19:21:48 GMT', 'connection': 'close', 'status': '200', 'content-location': 'http://10.0.0.125:9696/v2.0/qos/policies/31e15f98-8b03-4f8b-9a1a-27847ea48971/bandwidth_limit_rules/f17625ab-24c7-46c1-bcd2-0e326c9ac360'}
        Body: b'{"bandwidth_limit_rule": {"max_kbps": 2000, "max_burst_kbps": 2000, "direction": "egress", "id": "f17625ab-24c7-46c1-bcd2-0e326c9ac360"}}' _log_request_full /home/stack/tempest/tempest/lib/common/rest_client.py:456

Tags: api-ref qos
affects: kolla-ansible → neutron
description: updated
description: updated
tags: added: qos
Revision history for this message
Brian Haley (brian-haley) wrote :

I don't see anywhere in the neutron code we return HTTPAccepted, for example in any of the tests, only HTTPOk and HTTPCreated, so this might just be a typo in the api-ref doc. I'll ask someone with more QoS knowledge to look into it.

tags: added: api-ref
Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

Hello:

I think this is a mistake in the API reference in neutron-lib. Normal response for "update" commands in Neutron is 200. We should return HTTPOK here, not HTTPAccepted.

I'll push a patch for the api-ref in neutron-lib.

Regards.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-lib (master)
Changed in neutron:
status: New → In Progress
Revision history for this message
Arkady Shtempler (ashtempl) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron-lib (master)

Reviewed: https://review.opendev.org/c/openstack/neutron-lib/+/807390
Committed: https://opendev.org/openstack/neutron-lib/commit/670f83b0de1359dd301dd65ac2c2571f9d3ee193
Submitter: "Zuul (22348)"
Branch: master

commit 670f83b0de1359dd301dd65ac2c2571f9d3ee193
Author: Brian Haley <email address hidden>
Date: Fri Sep 3 14:28:50 2021 -0400

    Fix some api-ref typos

    There were some places in the API ref that it shows a 202 is
    returned on Update, but we always return a 200 (HTTPOk).
    Fixed a few other cases where Create (should be 201) and
    Delete (should be 204) were wrong as well.

    Change-Id: I4f6eb742f4420d0844e9c254ce989fc62973b0cf
    Closes-bug: #1942448

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
Brian Haley (brian-haley) wrote :

Arkady - yes, I believe it fixes that as well. Thanks for finding the issue!

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron-lib 2.16.0

This issue was fixed in the openstack/neutron-lib 2.16.0 release.

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.