Commit e9721add authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

cmdlib: Add function to list all instances on node

Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarIustin Pop <>
parent 5ba9701d
......@@ -715,6 +715,14 @@ def _GetNodeInstancesInner(cfg, fn):
return [i for i in cfg.GetAllInstancesInfo().values() if fn(i)]
def _GetNodeInstances(cfg, node_name):
"""Returns a list of all primary and secondary instances on a node.
return _GetNodeInstancesInner(cfg, lambda inst: node_name in inst.all_nodes)
def _GetNodePrimaryInstances(cfg, node_name):
"""Returns primary instances on a node.
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