Commit 71e1beef authored by Grégory Wisniewski's avatar Grégory Wisniewski

Add isIdentified() on Node class that check if an UUID is set on this node. The

purpose is to replace the so often used <node.getUUID() is not None> pattern.


git-svn-id: https://svn.erp5.org/repos/neo/trunk@1326 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent eb810f88
...@@ -85,6 +85,10 @@ class Node(object): ...@@ -85,6 +85,10 @@ class Node(object):
def isAdmin(self): def isAdmin(self):
return isinstance(self, AdminNode) return isinstance(self, AdminNode)
def isIdentified(self):
# XXX: knowing the node's UUID is sufficient ?
return self._uuid is not Node
def isRunning(self): def isRunning(self):
# FIXME: is it like 'connected' ? # FIXME: is it like 'connected' ?
return self._state == protocol.RUNNING_STATE return self._state == protocol.RUNNING_STATE
......
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