Commit 692738fc authored by Michael Hanselmann's avatar Michael Hanselmann

cmdlib: Function to get all secondary instances on a certain node

Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 6fd35c4d
......@@ -699,6 +699,19 @@ def _CheckInstanceBridgesExist(lu, instance, node=None):
_CheckNicsBridgesExist(lu, instance.nics, node)
def _GetNodeSecondaryInstances(cfg, node_name):
"""Returns secondary instances on a node.
"""
instances = []
for (_, inst) in cfg.GetAllInstancesInfo().iteritems():
if node_name in inst.secondary_nodes:
instances.append(inst)
return instances
class LUDestroyCluster(NoHooksLU):
"""Logical unit for destroying the cluster.
......
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