Fix LUOSDiagnose and non-vm_capable nodes
authorIustin Pop <iustin@google.com>
Wed, 26 Jan 2011 12:07:59 +0000 (13:07 +0100)
committerIustin Pop <iustin@google.com>
Wed, 26 Jan 2011 12:26:56 +0000 (13:26 +0100)
This skips non-vm_capable nodes in the OS diagnose search, since such
OSes will not be used anyway on those nodes.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

lib/cmdlib.py

index 655c25f..f4aa9a5 100644 (file)
@@ -3199,7 +3199,9 @@ class LUDiagnoseOS(NoHooksLU):
     """Compute the list of OSes.
 
     """
-    valid_nodes = [node for node in self.cfg.GetOnlineNodeList()]
+    valid_nodes = [node.name
+                   for node in self.cfg.GetAllNodesInfo().values()
+                   if not node.offline and node.vm_capable]
     node_data = self.rpc.call_os_diagnose(valid_nodes)
     pol = self._DiagnoseByOS(node_data)
     output = []