python: Fix object comparisons in Python 3.
authorRussell Bryant <russell@ovn.org>
Thu, 17 Dec 2015 17:55:43 +0000 (12:55 -0500)
committerRussell Bryant <russell@ovn.org>
Tue, 2 Feb 2016 21:42:32 +0000 (16:42 -0500)
commitfbafc3c263c489f383a3aa568e1fad46f8bfeec7
tree942bd17e1fe1a64f3d0837109210bd93af89a54d
parentc03afda69ae8b1be9d3d94ded0e1c12f6e886dba
python: Fix object comparisons in Python 3.

Python 3 no longer supports __cmp__.  Instead, we have to implement the
"rich comparison" operators.  We implement __eq__ and __lt__ and use
functools.total_ordering to implement the rest.

In one case, no __cmp__ method was provided and instead relied on the
default behavior provided in Python 2.  We have to implement the
comparisons explicitly for Python 3.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
python/ovs/db/data.py
python/ovs/db/idl.py