Commit b7a6a28e authored by Jameson Rollins's avatar Jameson Rollins

Add manager "completed" properties

arrived AND done.  closes #10.
parent 4b07178e
......@@ -260,6 +260,13 @@ class Node(object):
"""
return self.STATUS == 'DONE'
@property
def completed(self):
"""True is node has arrived at the request state, and state is done.
"""
return self.arrived and self.done
@property
def STALLED(self):
"""True if the node has stalled in the current state.
......@@ -434,6 +441,14 @@ class NodeManager(object):
return False
return True
@property
def completed(self):
"""Return True if all nodes are arrived and done."""
for node in self:
if not node.completed:
return False
return True
def get_stalled_nodes(self):
"""Return a list of all stalled nodes."""
return [node for node in self if node.STALLED]
......
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