Commit aef4e539 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Move the comparison method to the right class (Node instead of NodeManager)


git-svn-id: https://svn.erp5.org/repos/neo/trunk@1346 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 912e0a4d
......@@ -129,6 +129,12 @@ class Node(object):
""" Returned tuple is intented to be used in procotol encoders """
return (self.getType(), self._address, self._uuid, self._state)
def __gt__(self, node):
# sort per UUID if defined
if self._uuid is not None:
return self._uuid > node._uuid
return self._address > node._address
# XXX: for comptatibility, to be removed
def getType(self):
try:
......@@ -351,9 +357,3 @@ class NodeManager(object):
logging.debug(' * %32s | %17s | %22s | %s' % (
uuid, node.getType(), address, node.getState()))
def __gt__(self, node):
# sort per UUID if defined
if self._uuid is not None:
return self._uuid > node.uuid
return self._address > node._address
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment