Commit 00fb8246 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

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
parent 99e8295c
......@@ -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.
......
......@@ -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))
......
......@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment