Reviewed: https://review.opendev.org/c/openstack/nova/+/806294 Committed: https://opendev.org/openstack/nova/commit/1b6a6e3916806849025f3a90cd6ec48811b02e8a Submitter: "Zuul (22348)" Branch: master
commit 1b6a6e3916806849025f3a90cd6ec48811b02e8a Author: Ghanshyam Mann <[email protected]> Date: Thu Aug 26 19:46:09 2021 -0500 Convert features not supported error to HTTPBadRequest There is inconsistency on return code nova API return for "Feature not supported/implemented'. Current return code are 400, 409, and 403. - 400 case: Example: Multiattach Swap Volume Not Supported - 403 case: Cyborg integration - 409 case: Example: Operation Not Supported For SEV , Operation Not Supported For VTPM In xena PTG, we agreed to fix this by returning 400 in all cases - L446: https://etherpad.opendev.org/p/nova-xena-ptg This commit convert all the features not supported error to HTTPBadRequest(400). To avoid converting every NotSupported inherited exception in API controller to HTTPBadRequest generic conversion is added in expected_errors() decorator. Closes-Bug: #1938093 Change-Id: I410924668a73785f1bfe5c79827915d72e1d9e03 ** 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/1938093 Title: Inconsistent return code for "Feature not implemented' API Status in OpenStack Compute (nova): Fix Released Bug description: There is inconsistency on return code nova API return for "Feature not implemented'. Current return code are 400, 409, and 403. - 400 case: Example: Multiattach Swap Volume Not Supported: https://github.com/openstack/nova/blob/0c64f4c3eae8e2654ec11f60682c0fa5eda30c1a/nova/exception.py#L295 https://github.com/openstack/nova/blob/788035add9b32fa841389d906a0e307c231456ba/nova/api/openstack/compute/volumes.py#L429 - 403 case: Cyborg integration. https://github.com/openstack/nova/blob/0c64f4c3eae8e2654ec11f60682c0fa5eda30c1a/nova/exception.py#L158 https://github.com/openstack/nova/blob/0e7cd9d1a95a30455e3c91916ece590454235e0e/nova/api/openstack/compute/suspend_server.py#L47 - 409 case: Example: Operation Not Supported For SEV , Operation Not Supported For VTPM https://github.com/openstack/nova/blob/0c64f4c3eae8e2654ec11f60682c0fa5eda30c1a/nova/exception.py#L528-L537 In xena PTG, we agreed to fix this by returning 400 in all cases and backport the fix. L446: https://etherpad.opendev.org/p/nova-xena-ptg To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1938093/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

