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).
Reviewed: https:/ /review. openstack. org/449119 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=b2b366aa4aa 2b5199ddbd8cd51 019f3d8b7bccc3
Committed: https:/
Submitter: Jenkins
Branch: master
commit b2b366aa4aa2b51 99ddbd8cd51019f 3d8b7bccc3
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 api-version header)
difference as their versions (in the openstack-
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: Ic2b655ac4c75c6 104eddecd174f19 3413a0764d2
Closes-Bug: #1675143