Comment 16 for bug 1168260

Revision history for this message
Litty Preeth (littypreethkr) wrote :

Hi Qing,

Do you have any different approach for this? Actually Kevin's comment is valid. So changing the show method to not return any deleted flavor is not good. So I guess the solution is what Satyanarayana proposed:
"If flavor details are deleted then it has to show the deleted flavor details. If flavor details are deleted and recreated with the same id then it should show the newly created flavor details."

If we need to fix this without touching db.instance_type_get_by_flavor_id then we will need to add a new db api for returning all the flavors by id and then filter out in show or have a new db api which preferably returns the non-deleted flavor.

But looking at the other parts where db.instance_type_get_by_flavor_id is used (in the flavor_access APIs) it seems safe enough to change existing db.instance_type_get_by_flavor_id to return non-deleted flavor incase the query fetches more than one.

Being said that, I agree to the fact that "nova falvor-show id" should return only the non-deleted flavors to be consistent with "nova flavor-show name" and all the other show methods. But in that case the flavor-delete should not be allowed if instances created from that flavor are existing.

Regards,
Litty