← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1651312] Re: Request to delete flavor by name always returns 404 error

 

Actually I think this works in openstackclient, I think what you're
saying is Nova's REST API should support deleting a flavor by name, or
filtering flavors by name to make things more efficient? If so, that's a
REST API change and requires a blueprint and a spec, see:

https://specs.openstack.org/openstack/nova-specs/readme.html

** No longer affects: python-openstackclient

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

-- 
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/1651312

Title:
  Request to delete flavor by name always returns 404 error

Status in OpenStack Compute (nova):
  Invalid

Bug description:
  GET /v2/{tenant_id}/flavors/{flavor_name} always returns 404. 
  This first request  to Nova-api is always returned with 404 when name is given as parameter. Because in \nova\api\openstack\compute\flavors.py\show(self, req, id) flavor is fetched by id (flavor=flavor.get_flavor_by_flavor_id(id, ctxt=context)). 

  This raises 404  Exception as there is no implementation for fetching flavor by name. 
  However, client is sending Delete-flavor request using name, not id. 

  
  Steps to reproduce:
  =========================================================
  1. Delete a flavor by name
  command: openstack flavor delete <flavor_name>
  2. Fetch nova-api.log

  
  Expected Result
  =========================================================
  Flavor to be fetched by name. And then a DELETE request is to be made.

  
  Actual Result
  =========================================================
  Flavor is not found by name. Then a GET request is made to fetch all the flavors.
  Then Flavor is fetched by id. Then a DELETE request is made.

  
  Nova-api LOGS:
  =========================================================
  2016-12-03 08:40:27.229 18000 INFO nova.api.openstack.wsgi [req-90abafdf-1db2-4f01-98f5-5a22b87a0a21 94edd5c88daf4bec84f4f8a3e8efcdd3 8c9b125ddfb64bbe89aa0c9229f3209a - default default] HTTP exception thrown: Flavor test1 could not be found.
  2016-12-03 08:40:27.231 18000 INFO nova.osapi_compute.wsgi.server [req-90abafdf-1db2-4f01-98f5-5a22b87a0a21 94edd5c88daf4bec84f4f8a3e8efcdd3 8c9b125ddfb64bbe89aa0c9229f3209a - default default] 10.0.2.15 "GET /v2.1/8c9b125ddfb64bbe89aa0c9229f3209a/flavors/test1 HTTP/1.1" status: 404 len: 432 time: 0.1308930
  2016-12-03 08:40:27.262 18000 INFO nova.osapi_compute.wsgi.server [req-f80406c3-2c1f-41a7-af42-f331c7c4c0be 94edd5c88daf4bec84f4f8a3e8efcdd3 8c9b125ddfb64bbe89aa0c9229f3209a - default default] 10.0.2.15 "GET /v2.1/8c9b125ddfb64bbe89aa0c9229f3209a/flavors?is_public=None HTTP/1.1" status: 200 len: 2566 time: 0.0284660
  2016-12-03 08:40:27.280 18000 INFO nova.osapi_compute.wsgi.server [req-2a26788e-3a40-4c5e-a203-99488038c5f6 94edd5c88daf4bec84f4f8a3e8efcdd3 8c9b125ddfb64bbe89aa0c9229f3209a - default default] 10.0.2.15 "GET /v2.1/8c9b125ddfb64bbe89aa0c9229f3209a/flavors/868727e7-aac0-490b-8223-54f9194abe49 HTTP/1.1" status: 200 len: 854 time: 0.0135860
  2016-12-03 08:40:27.335 18000 INFO nova.osapi_compute.wsgi.server [req-76c6cab4-0e74-4627-832c-9a73df60f228 94edd5c88daf4bec84f4f8a3e8efcdd3 8c9b125ddfb64bbe89aa0c9229f3209a - default default] 10.0.2.15 "DELETE /v2.1/8c9b125ddfb64bbe89aa0c9229f3209a/flavors/868727e7-aac0-490b-8223-54f9194abe49 HTTP/1.1" status: 202 len: 337 time: 0.0498672

  
  Implementation should be made for fetching flavor by name.

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


References