diff --git a/lib/config.py b/lib/config.py index f1c9bf2284766d794c97712fef076f7eb19fdb08..f939ecff93a8a3fcbdc410269c0def79d3cf6672 100644 --- a/lib/config.py +++ b/lib/config.py @@ -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.