Revision 2674690b lib/config.py
b/lib/config.py | ||
---|---|---|
1243 | 1243 |
return self._UnlockedGetInstanceInfo(instance_name) |
1244 | 1244 |
|
1245 | 1245 |
@locking.ssynchronized(_config_lock, shared=1) |
1246 |
def GetInstanceNodeGroups(self, instance_name, primary_only=False): |
|
1247 |
"""Returns set of node group UUIDs for instance's nodes. |
|
1248 |
|
|
1249 |
@rtype: frozenset |
|
1250 |
|
|
1251 |
""" |
|
1252 |
instance = self._UnlockedGetInstanceInfo(instance_name) |
|
1253 |
if not instance: |
|
1254 |
raise errors.ConfigurationError("Unknown instance '%s'" % instance_name) |
|
1255 |
|
|
1256 |
if primary_only: |
|
1257 |
nodes = [instance.primary_node] |
|
1258 |
else: |
|
1259 |
nodes = instance.all_nodes |
|
1260 |
|
|
1261 |
return frozenset(self._UnlockedGetNodeInfo(node_name).group |
|
1262 |
for node_name in nodes) |
|
1263 |
|
|
1264 |
@locking.ssynchronized(_config_lock, shared=1) |
|
1246 | 1265 |
def GetAllInstancesInfo(self): |
1247 | 1266 |
"""Get the configuration of all instances. |
1248 | 1267 |
|
Also available in: Unified diff