From 12c3449a73f30f13437e4e888812b969898ed8d4 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Wed, 21 Nov 2007 16:55:48 +0000 Subject: [PATCH] Replace disk template drbd8 with drbd where missing. Reviewed-by: iustinp --- lib/cmdlib.py | 4 ++-- scripts/gnt-instance | 4 ++-- tools/burnin | 15 +++++---------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/lib/cmdlib.py b/lib/cmdlib.py index ff4fa147a..cf44b603e 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -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 diff --git a/scripts/gnt-instance b/scripts/gnt-instance index aaa780935..323e09f59 100755 --- a/scripts/gnt-instance +++ b/scripts/gnt-instance @@ -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," diff --git a/tools/burnin b/tools/burnin index a43caddad..2f2edc355 100755 --- a/tools/burnin +++ b/tools/burnin @@ -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 -- GitLab