← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1611458] [NEW] MIgration incorrectly compares None as greater than any time

 

Public bug reported:

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

** Affects: nova
     Importance: Undecided
     Assignee: Ed Leafe (ed-leafe)
         Status: New

** Changed in: nova
     Assignee: (unassigned) => Ed Leafe (ed-leafe)

-- 
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):
  New

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


Follow ups