Replace disk template drbd8 with drbd where missing.
authorMichael Hanselmann <hansmi@google.com>
Wed, 21 Nov 2007 16:55:48 +0000 (16:55 +0000)
committerMichael Hanselmann <hansmi@google.com>
Wed, 21 Nov 2007 16:55:48 +0000 (16:55 +0000)
Reviewed-by: iustinp

lib/cmdlib.py
scripts/gnt-instance
tools/burnin

index ff4fa14..cf44b60 100644 (file)
@@ -3375,12 +3375,12 @@ class LUReplaceDisks(LogicalUnit):
         self.op.mode = constants.REPLACE_DISK_SEC
 
       if self.op.mode == constants.REPLACE_DISK_ALL:
-        raise errors.OpPrereqError("Template 'drbd8' only allows primary or"
+        raise errors.OpPrereqError("Template 'drbd' only allows primary or"
                                    " secondary disk replacement, not"
                                    " both at once")
       elif self.op.mode == constants.REPLACE_DISK_PRI:
         if remote_node is not None:
-          raise errors.OpPrereqError("Template 'drbd8' does not allow changing"
+          raise errors.OpPrereqError("Template 'drbd' does not allow changing"
                                      " the secondary while doing a primary"
                                      " node disk replacement")
         self.tgt_node = instance.primary_node
index aaa7809..323e09f 100755 (executable)
@@ -781,11 +781,11 @@ commands = {
                      make_option("-p", "--on-primary", dest="on_primary",
                                  default=False, action="store_true",
                                  help=("Replace the disk(s) on the primary"
-                                       " node (only for the drbd8 template)")),
+                                       " node (only for the drbd template)")),
                      make_option("-s", "--on-secondary", dest="on_secondary",
                                  default=False, action="store_true",
                                  help=("Replace the disk(s) on the secondary"
-                                       " node (only for the drbd8 template)")),
+                                       " node (only for the drbd template)")),
                      make_option("--disks", dest="disks", default=None,
                                  help=("Comma-separated list of disks"
                                        " to replace (e.g. sda) (optional,"
index a43cadd..2f2edc3 100755 (executable)
@@ -121,10 +121,10 @@ class Burner(object):
                       help="Skip instance failovers", action="store_false",
                       default=True)
     parser.add_option("-t", "--disk-template", dest="disk_template",
-                      choices=("remote_raid1", "drbd8"),
+                      choices=("remote_raid1", "drbd"),
                       default="remote_raid1",
                       help="Template type for network mirroring (remote_raid1"
-                      " or drbd8) [remote_raid1]")
+                      " or drbd) [remote_raid1]")
     parser.add_option("-n", "--nodes", dest="nodes", default="",
                       help="Comma separated list of nodes to perform"
                       " the burnin on (defaults to all nodes)")
@@ -133,17 +133,12 @@ class Burner(object):
     if len(args) < 1 or options.os is None:
       Usage()
 
-    if options.disk_template == "plain":
-      disk_template = constants.DT_PLAIN
-    elif options.disk_template == "remote_raid1":
-      disk_template = constants.DT_REMOTE_RAID1
-    elif options.disk_template == "drbd8":
-      disk_template = constants.DT_DRBD8
-    else:
+    supported_disk_templates = (constants.DT_PLAIN, constants.DT_REMOTE_RAID1,
+                                constants.DT_DRBD8)
+    if options.disk_template not in supported_disk_templates:
       Log("Unknown disk template '%s'" % options.disk_template)
       sys.exit(1)
 
-    options.disk_template = disk_template
     self.opts = options
     self.instances = args