burnin: improve instance create message
authorGuido Trotter <ultrotter@google.com>
Wed, 23 Apr 2008 14:51:47 +0000 (14:51 +0000)
committerGuido Trotter <ultrotter@google.com>
Wed, 23 Apr 2008 14:51:47 +0000 (14:51 +0000)
When the allocator or a non-mirrored template are used the message shown by
burnin at instance creation time was wrong. Fixing it.

Reviewed-by: iustinp

tools/burnin

index 63ffb2e..2793f3c 100755 (executable)
@@ -207,6 +207,14 @@ class Burner(object):
     for pnode, snode, instance in mytor:
       if self.opts.iallocator:
         pnode = snode = None
+        Log("- Add instance %s (iallocator: %s)" %
+              (instance, self.opts.iallocator))
+      elif self.opts.disk_template not in constants.DTS_NET_MIRROR:
+        snode = None
+        Log("- Add instance %s on node %s" % (instance, pnode))
+      else:
+        Log("- Add instance %s on nodes %s/%s" % (instance, pnode, snode))
+
       op = opcodes.OpCreateInstance(instance_name=instance,
                                     mem_size=128,
                                     disk_size=self.opts.os_size,
@@ -227,7 +235,6 @@ class Burner(object):
                                     file_driver="loop",
                                     file_storage_dir=None,
                                     iallocator=self.opts.iallocator)
-      Log("- Add instance %s on nodes %s/%s" % (instance, pnode, snode))
       self.ExecOp(op)
       self.to_rem.append(instance)