Commit 0b2de758 authored by Iustin Pop's avatar Iustin Pop
Browse files

Add an atomic ConfigWrite.GetAllInstanceInfo()

In order to be able to query instance without locking them, we need the
same atomic query of multiple instances as for nodes.

Reviewed-by: ultrotter
parent 94bbfece
......@@ -469,6 +469,19 @@ class ConfigWriter:
"""
return self._UnlockedGetInstanceInfo(instance_name)
@locking.ssynchronized(_config_lock, shared=1)
def GetAllInstancesInfo(self):
"""Get the configuration of all instances.
@rtype: dict
@returns: dict of (instance, instance_info), where instance_info is what
would GetInstanceInfo return for the node
"""
my_dict = dict([(node, self._UnlockedGetInstanceInfo(node))
for node in self._UnlockedGetInstanceList()])
return my_dict
@locking.ssynchronized(_config_lock)
def AddNode(self, node):
"""Add a node to the configuration.
......
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