Fix an error handling case in instance info
[ganeti-local] / lib / config.py
index 5fd410b..29acbd1 100644 (file)
@@ -787,6 +787,15 @@ class ConfigWriter:
     return self._UnlockedGetNodeList()
 
   @locking.ssynchronized(_config_lock, shared=1)
+  def GetOnlineNodeList(self):
+    """Return the list of nodes which are online.
+
+    """
+    all_nodes = [self._UnlockedGetNodeInfo(node)
+                 for node in self._UnlockedGetNodeList()]
+    return [node.name for node in all_nodes if not node.offline]
+
+  @locking.ssynchronized(_config_lock, shared=1)
   def GetAllNodesInfo(self):
     """Get the configuration of all nodes.
 
@@ -983,6 +992,7 @@ class ConfigWriter:
       constants.SS_MASTER_NODE: cluster.master_node,
       constants.SS_NODE_LIST: node_data,
       constants.SS_OFFLINE_NODES: off_data,
+      constants.SS_RELEASE_VERSION: constants.RELEASE_VERSION,
       }
 
   @locking.ssynchronized(_config_lock)