Revision c71b049c lib/config.py

b/lib/config.py
1365 1365
        sec.append(inst.name)
1366 1366
    return (pri, sec)
1367 1367

  
1368
  @locking.ssynchronized(_config_lock, shared=1)
1369
  def GetNodeGroupInstances(self, uuid, primary_only=False):
1370
    """Get the instances of a node group.
1371

  
1372
    @param uuid: Node group UUID
1373
    @param primary_only: Whether to only consider primary nodes
1374
    @rtype: frozenset
1375
    @return: List of instance names in node group
1376

  
1377
    """
1378
    if primary_only:
1379
      nodes_fn = lambda inst: [inst.primary_node]
1380
    else:
1381
      nodes_fn = lambda inst: inst.all_nodes
1382

  
1383
    return frozenset(inst.name
1384
                     for inst in self._config_data.instances.values()
1385
                     for node_name in nodes_fn(inst)
1386
                     if self._UnlockedGetNodeInfo(node_name).group == uuid)
1387

  
1368 1388
  def _UnlockedGetNodeList(self):
1369 1389
    """Return the list of nodes which are in the configuration.
1370 1390

  

Also available in: Unified diff