flavor-show of mixed case flavorid fails

Bug #1446850 reported by melanie witt
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-novaclient
Fix Released
High
melanie witt

Bug Description

The fix for bug 1423885 broke flavor-show for flavorids with upper case letters:

Excerpts from bug 1423885:

"This fix broke it for people with flavorid with upper case like "SuperCase1".

To reproduce:
- nova --debug flavor-create SuperCase1 SuperCase1 512 10 1
- nova --debug flavor-show SuperCase1

This also breaks nova boot which won't be able to find the flavor by id.

Please also consider installations with existing flavor ids which can't be changed for obvious reasons."

I found the problem is that the server side db item caching keys off flavorid from the result of the db query in a case-sensitive manner, so the flavor can't be found in the cache if novaclient sends an all lowercase flavorid.

Ideally maybe nova would treat flavorid as case-insensitive in the cache as it does with the db query, but since this breaks existing users with mixed case flavorids, I think we have to revert https://review.openstack.org/158270 or treat flavor name differently than flavorid if we can.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (master)

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

Changed in python-novaclient:
assignee: nobody → melanie witt (melwitt)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/176106
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=098116d6a574b8dede101b257db2ff22d269c6c7
Submitter: Jenkins
Branch: master

commit 098116d6a574b8dede101b257db2ff22d269c6c7
Author: melanie witt <email address hidden>
Date: Tue Apr 21 21:32:33 2015 +0000

    Revert "nova flavor-show command is inconsistent"

    This reverts commit 4e79285b45ec1490c8e923f724cbaf4d42fe81c4.

    The aforementioned commit broke flavor-show for mixed case flavorids.
    The reason is a bit complex. On the nova api side, there is caching of
    db items for flavors, keyed off the flavorid retrieved from the db,
    case sensitive, unlike the db query itself. Attempts to flavor-show
    a flavor with flavorid composed of letters will fail with a 400 if
    the capitalization doesn't match.

    For the flavor names, they work in lowercase because the find_resource
    function falls back on a search by "human_id" after failing every other
    attempt to find the flavor, because "human_id" is a oslo-slugified
    string (all lowercase, non-word characters removed, spaces converted
    to hyphens).

    Closes-Bug: #1446850

    Change-Id: I73247b50f5a6918167c071ccc13cd676aa2c7fec

Changed in python-novaclient:
status: In Progress → Fix Committed
Matt Riedemann (mriedem)
Changed in python-novaclient:
milestone: none → 2.25.0
Matt Riedemann (mriedem)
Changed in python-novaclient:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/303051

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-novaclient (stable/kilo)

Change abandoned by Tony Breeds (<email address hidden>) on branch: stable/kilo
Review: https://review.openstack.org/303051
Reason: This review is being abandoned as the stable/kilo will go End-Of-Life (EOL) in the near future.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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