mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-23 07:33:27 -06:00
kerberos: fix sorting Principal objects
When service-find was issued under Python 3, the command fails because it tried to sort a list of Principal objects which was not possible. https://pagure.io/freeipa/issue/4985 Reviewed-By: Felipe Volpone <fbarreto@redhat.com>
This commit is contained in:
parent
7995518921
commit
dbeb41efd6
@ -93,6 +93,18 @@ class Principal(object):
|
|||||||
def __ne__(self, other):
|
def __ne__(self, other):
|
||||||
return not self.__eq__(other)
|
return not self.__eq__(other)
|
||||||
|
|
||||||
|
def __lt__(self, other):
|
||||||
|
return unicode(self) < unicode(other)
|
||||||
|
|
||||||
|
def __le__(self, other):
|
||||||
|
return self.__lt__(other) or self.__eq__(other)
|
||||||
|
|
||||||
|
def __gt__(self, other):
|
||||||
|
return not self.__le__(other)
|
||||||
|
|
||||||
|
def __ge__(self, other):
|
||||||
|
return self.__gt__(other) or self.__eq__(other)
|
||||||
|
|
||||||
def __hash__(self):
|
def __hash__(self):
|
||||||
return hash(self.components + (self.realm,))
|
return hash(self.components + (self.realm,))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user