burnin: do not use offline nodes
authorIustin Pop <iustin@google.com>
Fri, 9 Jan 2009 14:26:53 +0000 (14:26 +0000)
committerIustin Pop <iustin@google.com>
Fri, 9 Jan 2009 14:26:53 +0000 (14:26 +0000)
This patch makes burnin skip the offline nodes in it's builtin node
selection. It also removes an extra line.

Reviewed-by: imsnah

tools/burnin

index 018396c..1170108 100755 (executable)
@@ -231,13 +231,13 @@ class Burner(object):
     else:
       names = []
     try:
-      op = opcodes.OpQueryNodes(output_fields=["name"], names=names)
+      op = opcodes.OpQueryNodes(output_fields=["name", "offline"], names=names)
       result = self.ExecOp(op)
     except errors.GenericError, err:
       err_code, msg = cli.FormatError(err)
       Log(msg)
       sys.exit(err_code)
-    self.nodes = [data[0] for data in result]
+    self.nodes = [data[0] for data in result if not data[1]]
 
     result = self.ExecOp(opcodes.OpDiagnoseOS(output_fields=["name", "valid"],
                                               names=[]))
@@ -452,7 +452,6 @@ class Burner(object):
       Log("- Remove instance %s" % instance)
       self.ExecOp(op)
 
-
   def Rename(self):
     """Rename the instances."""
     rename = self.opts.rename