placement microversion comparisons are sometimes floats

Bug #1675143 reported by Chris Dent
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Chris Dent

Bug Description

In a few different places in the placement API (as of version 1.5) there are microversion comparisons which are based on floats. This means that version 1.20 will evaluate as "older" than 1.3, which totally wrong.

This is pretty much my bad, so I'm glad I noticed just now. We've got a bit of time to fix this (before 1.10) comes along, but should get to it soon.

Sigh.

Tags: placement
Changed in nova:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/449119
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=b2b366aa4aa2b5199ddbd8cd51019f3d8b7bccc3
Submitter: Jenkins
Branch: master

commit b2b366aa4aa2b5199ddbd8cd51019f3d8b7bccc3
Author: Chris Dent <email address hidden>
Date: Thu Mar 23 12:33:00 2017 +0000

    [placement] Don't use floats in microversion handling

    When microversioned request handling was added to placement some
    comparisons were added that treat the microversions as floats. This
    will break as soon as the right hand side of the version chnages
    from one digit to two. A float of 1.1 and 1.10 is the same. A
    version string of '1.1' and '1.10' is not.

    This patch changes the internals of version handling to always use
    Version objects which represent the versions using a name tuple
    (major=1, minor=10). It also changes the externals to expect versions
    as strings ('1.10'). Where floats were present before, these have
    been changed to strings. Where tuples have been accepted, these are
    still accepted, but strings are as well.

    This is an internal only change, users shouldn't notice any
    difference as their versions (in the openstack-api-version header)
    were always strings and we haven't made it to version 1.10, sorry
    '1.10', yet.

    If developers try to version_handler with something other than a
    version string, test runs will fail very early (at import time).

    Change-Id: Ic2b655ac4c75c6104eddecd174f193413a0764d2
    Closes-Bug: #1675143

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 16.0.0.0b1

This issue was fixed in the openstack/nova 16.0.0.0b1 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.