Commit c5b3cd6a by Dudás Ádám

manager: add trait checking to scheduler

parent d5924475
...@@ -3,6 +3,8 @@ def get_node(instance, nodes): ...@@ -3,6 +3,8 @@ def get_node(instance, nodes):
''' '''
# Return first Node or None # Return first Node or None
try: try:
req_traits = set(instance.req_traits.all())
nodes = [n for n in nodes if req_traits.issubset(n.traits.all())]
return nodes[0] return nodes[0]
except: except:
return None return None
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 sign in to comment