Flavor ids with leading '0' not supported in Trove

Bug #1603187 reported by Peter Stachowski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Fix Released
High
Peter Stachowski

Bug Description

When Trove moved to support alphanumeric flavor ids, the case of having a numeric string id with leading zeros was not taken into account. The behavior on the client side is to see if the id is all digits, and if so it is converted to an int. That means that a flavor of '01' will be incorrectly interpreted as '1'. On the server side the code checks if the flavor id can be converted to an int, and if so then sets it as such - the manifestation being that if the str_id is '01' then the id will be set to '1' instead of None as it should be.

The logic should be unified (say to "id.isdigit() and not id.startswith('0')").

Changed in trove:
assignee: nobody → Peter Stachowski (peterstac)
importance: Undecided → High
milestone: none → next
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to trove (master)

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

Changed in trove:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to trove (master)

Reviewed: https://review.openstack.org/342457
Committed: https://git.openstack.org/cgit/openstack/trove/commit/?id=afb29a398cc73849ded2ef191513346cebb14834
Submitter: Jenkins
Branch: master

commit afb29a398cc73849ded2ef191513346cebb14834
Author: Peter Stachowski <email address hidden>
Date: Thu Jul 14 22:32:05 2016 +0000

    Support flavor ids with leading '0'

    When Trove moved to support alphanumeric flavor ids, the case of having
    a numeric string id with leading zeros was not taken into account.
    On the server side the code checks if the flavor id can be converted
    to an int, and if so then sets it as such - the manifestation being
    that if the str_id is '01' then the id will be set to '1' instead
    of None as it should be.

    This behavior has been fixed and unit tests created.

    Change-Id: I87a8ac98d4358b75182c987f584c6098398a0c2a
    Depends-On: I5acdec576a2e7da6cbfbb1cfc61c49fbbf7379af
    Closes-Bug: #1603187

Changed in trove:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/trove 6.0.0.0b3

This issue was fixed in the openstack/trove 6.0.0.0b3 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

This issue was fixed in the openstack/trove 6.0.0.0b3 development milestone.

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.