Skip to content

Commit

Permalink
CLOUD-2456 Make probe Status Enum sortable
Browse files Browse the repository at this point in the history
Signed-off-by: rcernich <rcernich@redhat.com>
  • Loading branch information
rcernich committed Apr 26, 2018
1 parent 1963baf commit 6a0169a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions os-eap-probes/added/probes/probe/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,31 @@ class Status(Enum):
def __str__(self):
return self.name

def __cmp__(self, other):
if type(other) is self.__class__:
return self.value - other.value
return NotImplemented

def __le__(self, other):
if type(other) is self.__class__:
return self.value <= other.value
return NotImplemented

def __lt__(self, other):
if type(other) is self.__class__:
return self.value < other.value
return NotImplemented

def __ge__(self, other):
if type(other) is self.__class__:
return self.value >= other.value
return NotImplemented

def __gt__(self, other):
if type(other) is self.__class__:
return self.value > other.value
return NotImplemented

class Test(object):
"""
An object which provides a query and evaluates the response. A Probe may
Expand Down

0 comments on commit 6a0169a

Please sign in to comment.