yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #59710
[Bug 1611458] Re: MIgration incorrectly compares None as greater than any time
Reviewed: https://review.openstack.org/353123
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=ba27ae7a4b5435cf95d42df818903a23d8133783
Submitter: Jenkins
Branch: master
commit ba27ae7a4b5435cf95d42df818903a23d8133783
Author: EdLeafe <ed@xxxxxxxxx>
Date: Tue Aug 9 21:48:30 2016 +0000
Correct the sorting of datetimes for migrations
In commit e5269b3a8f95c41283a9e6109835142586fe62a6, the code to compare
the updated_at times for different migration objects was changed to make
it Python3 compatible. However, there was a logical error introduced,
whereby migrations with a value of None for their updated_at attribute
were considered as more recent than those with actual values. This fixes
that logic so that None values always sort as older than actual values.
Closes-Bug: #1611458
Change-Id: If4feceb9e385f962fdf690f3ed62f63a19c61d7d
** Changed in: nova
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1611458
Title:
MIgration incorrectly compares None as greater than any time
Status in OpenStack Compute (nova):
Fix Released
Bug description:
Description
===========
The code in nova/compute/resource_tracker.py was updated in commit e5269b3a8f95c41283a9e6109835142586fe62a6 to better handle the comparison of potential None values in order to make the code Python 3 compatible. Unfortunately, the logic is incorrect, and will consider a migration with a None value for updated_at as more recent than a migration with a non-None datetime value.
Steps to reproduce
==================
The easiest way to reproduce is to run the unit test here:
https://review.openstack.org/#/c/350319/8/nova/tests/unit/compute/test_tracker.py@1827
Note that it now has to *expect* the None value to be preferred over
an actual value
Expected result
===============
Any migration that has been updated is always more recent than one that hasn't, so I would expect that any None-valued migration would not be selected over an actual date.
Actual result
=============
The None value is selected over one that has been updated.
Environment
===========
Nova master
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1611458/+subscriptions
References