Comment 4 for bug 1819274

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

Reviewed: https://review.openstack.org/643717
Committed: https://git.openstack.org/cgit/openstack/rally/commit/?id=de4ea09398a3d3e8a71213c4b6905be979f47626
Submitter: Zuul
Branch: master

commit de4ea09398a3d3e8a71213c4b6905be979f47626
Author: Dmitrii Shcherbakov <email address hidden>
Date: Sat Mar 16 21:13:33 2019 +0300

    Task context: implement comparison operators

    __cmp__ is no longer used in python3

    Other operators need to be defined instead.

    https://docs.python.org/3/whatsnew/3.0.html#ordering-comparisons
    "The cmp() function should be treated as gone, and the __cmp__() special
    method is no longer supported. Use __lt__() for sorting, __eq__() with
    __hash__(), and other rich comparisons as needed. (If you really need
    the cmp() functionality, you could use the expression (a > b) - (a < b)
    as the equivalent for cmp(a, b).)"

    https://www.python.org/dev/peps/pep-0207/

    This change does it based on get_order and class meta properties.

    Downstream projects that rely on context comparison (such as
    rally-openstack) will benefit from this change.

    Change-Id: I4991acccefd4754e209feafd5e24d03c76c283f8
    Depends-On: I42db6045ae88c34d3576beb737bb7e955c5f2132
    Needed-By: I6bb31fe1d3f79a8fd4707a5576204dee69a3f307
    Partial-Bug: #1819274