From 00fb824669888dce00af0b3932ff0c736f6e2e2f Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Wed, 25 Jun 2008 08:07:19 +0000 Subject: [PATCH] Cleanup old DRBD 0.7.x code Apparently there were still some leftovers. While removing an instance, I got the message "unhandled exception 'module' object has no attribute 'LD_MD_R1'". Reviewed-by: iustinp --- lib/cmdlib.py | 16 ---------------- lib/objects.py | 16 ++++------------ scripts/gnt-instance | 2 +- 3 files changed, 5 insertions(+), 29 deletions(-) diff --git a/lib/cmdlib.py b/lib/cmdlib.py index cc1ead5f4..69bb2318a 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -2701,22 +2701,6 @@ def _GenerateUniqueNames(cfg, exts): return results -def _GenerateMDDRBDBranch(cfg, primary, secondary, size, names): - """Generate a drbd device complete with its children. - - """ - port = cfg.AllocatePort() - vgname = cfg.GetVGName() - dev_data = objects.Disk(dev_type=constants.LD_LV, size=size, - logical_id=(vgname, names[0])) - dev_meta = objects.Disk(dev_type=constants.LD_LV, size=128, - logical_id=(vgname, names[1])) - drbd_dev = objects.Disk(dev_type=constants.LD_DRBD7, size=size, - logical_id = (primary, secondary, port), - children = [dev_data, dev_meta]) - return drbd_dev - - def _GenerateDRBD8Branch(cfg, primary, secondary, size, names, iv_name): """Generate a drbd8 device complete with its children. diff --git a/lib/objects.py b/lib/objects.py index d67e31cf2..522162a7b 100644 --- a/lib/objects.py +++ b/lib/objects.py @@ -277,13 +277,11 @@ class Disk(ConfigObject): def CreateOnSecondary(self): """Test if this device needs to be created on a secondary node.""" - return self.dev_type in (constants.LD_DRBD7, constants.LD_DRBD8, - constants.LD_LV) + return self.dev_type in (constants.LD_DRBD8, constants.LD_LV) def AssembleOnSecondary(self): """Test if this device needs to be assembled on a secondary node.""" - return self.dev_type in (constants.LD_DRBD7, constants.LD_DRBD8, - constants.LD_LV) + return self.dev_type in (constants.LD_DRBD8, constants.LD_LV) def OpenOnSecondary(self): """Test if this device needs to be opened on a secondary node.""" @@ -326,8 +324,7 @@ class Disk(ConfigObject): devices needs to (or can) be assembled. """ - if self.dev_type in [constants.LD_LV, constants.LD_MD_R1, - constants.LD_FILE]: + if self.dev_type in [constants.LD_LV, constants.LD_FILE]: result = [node] elif self.dev_type in constants.LDS_DRBD: result = [self.logical_id[0], self.logical_id[1]] @@ -470,10 +467,7 @@ class Disk(ConfigObject): if self.dev_type == constants.LD_LV: val = "<LogicalVolume(/dev/%s/%s" % self.logical_id elif self.dev_type in constants.LDS_DRBD: - if self.dev_type == constants.LD_DRBD7: - val = "<DRBD7(" - else: - val = "<DRBD8(" + val = "<DRBD8(" if self.physical_id is None: phy = "unconfigured" else: @@ -488,8 +482,6 @@ class Disk(ConfigObject): val += "backend=%s, metadev=%s" % (self.children[0], self.children[1]) else: val += "no local storage" - elif self.dev_type == constants.LD_MD_R1: - val = "<MD_R1(uuid=%s, children=%s" % (self.physical_id, self.children) else: val = ("<Disk(type=%s, logical_id=%s, physical_id=%s, children=%s" % (self.dev_type, self.logical_id, self.physical_id, self.children)) diff --git a/scripts/gnt-instance b/scripts/gnt-instance index 06caf943f..45d7fd483 100755 --- a/scripts/gnt-instance +++ b/scripts/gnt-instance @@ -590,7 +590,7 @@ def _FormatBlockDevInfo(buf, dev, indent_level): minor_string = str(minor) buf.write("%s (%s:%s)" % (path, major_string, minor_string)) - if dtype in (constants.LD_MD_R1, constants.LD_DRBD7, constants.LD_DRBD8): + if dtype in (constants.LD_DRBD8, ): if syncp is not None: sync_text = "*RECOVERING* %5.2f%%," % syncp if estt: -- GitLab