Commit 66a37e7a authored by Helga Velroyen's avatar Helga Velroyen
Browse files

Rename LDS_DRBD to DTS_DRBD



This patch renames the constant 'LDS_DRBD' to 'DTS_DRBD'
to make it consistent with the renaming of LD_* constants
to DT_* constants.
Signed-off-by: default avatarHelga Velroyen <helgav@google.com>
Reviewed-by: default avatarThomas Thrainer <thomasth@google.com>
parent 8451bfdb
......@@ -3242,7 +3242,7 @@ class LUInstanceSetParams(LogicalUnit):
self.cfg.GetNodeName(node_uuid), msg)
# if this is a DRBD disk, return its port to the pool
if root.dev_type in constants.LDS_DRBD:
if root.dev_type in constants.DTS_DRBD:
self.cfg.AddTcpUdpPort(root.logical_id[2])
def _CreateNewNic(self, idx, params, private):
......
......@@ -341,7 +341,7 @@ class LUInstanceQueryData(NoHooksLU):
"""
drbd_info = None
if dev.dev_type in constants.LDS_DRBD:
if dev.dev_type in constants.DTS_DRBD:
# we change the snode then (otherwise we use the one passed in)
if dev.logical_id[0] == instance.primary_node:
snode_uuid = dev.logical_id[1]
......
......@@ -281,7 +281,7 @@ def RemoveDisks(lu, instance, target_node_uuid=None, ignore_failures=False):
all_result = False
# if this is a DRBD disk, return its port to the pool
if device.dev_type in constants.LDS_DRBD:
if device.dev_type in constants.DTS_DRBD:
ports_to_release.add(device.logical_id[2])
if all_result or ignore_failures:
......
......@@ -713,7 +713,7 @@ class ConfigWriter:
# gather the drbd ports for duplicate checks
for (idx, dsk) in enumerate(instance.disks):
if dsk.dev_type in constants.LDS_DRBD:
if dsk.dev_type in constants.DTS_DRBD:
tcp_port = dsk.logical_id[2]
if tcp_port not in ports:
ports[tcp_port] = []
......
......@@ -572,6 +572,9 @@ DTS_BLOCK = compat.UniqueFrozenset([
DT_EXT,
])
# the set of drbd-like disk types
DTS_DRBD = compat.UniqueFrozenset([DT_DRBD8])
# drbd constants
DRBD_HMAC_ALG = "md5"
DRBD_DEFAULT_NET_PROTOCOL = "C"
......@@ -606,9 +609,6 @@ RBD_CMD = "rbd"
FD_LOOP = "loop"
FD_BLKTAP = "blktap"
# the set of drbd-like disk types
LDS_DRBD = compat.UniqueFrozenset([DT_DRBD8])
# disk access mode
DISK_RDONLY = "ro"
DISK_RDWR = "rw"
......
......@@ -584,7 +584,7 @@ class Disk(ConfigObject):
constants.DT_BLOCK, constants.DT_RBD,
constants.DT_EXT, constants.DT_SHARED_FILE]:
result = [node_uuid]
elif self.dev_type in constants.LDS_DRBD:
elif self.dev_type in constants.DTS_DRBD:
result = [self.logical_id[0], self.logical_id[1]]
if node_uuid not in result:
raise errors.ConfigurationError("DRBD device passed unknown node")
......@@ -719,7 +719,7 @@ class Disk(ConfigObject):
if self.logical_id is None and self.physical_id is not None:
return
if self.dev_type in constants.LDS_DRBD:
if self.dev_type in constants.DTS_DRBD:
pnode_uuid, snode_uuid, port, pminor, sminor, secret = self.logical_id
if target_node_uuid not in (pnode_uuid, snode_uuid):
raise errors.ConfigurationError("DRBD device not knowing node %s" %
......@@ -766,7 +766,7 @@ class Disk(ConfigObject):
obj.logical_id = tuple(obj.logical_id)
if obj.physical_id and isinstance(obj.physical_id, list):
obj.physical_id = tuple(obj.physical_id)
if obj.dev_type in constants.LDS_DRBD:
if obj.dev_type in constants.DTS_DRBD:
# we need a tuple of length six here
if len(obj.logical_id) < 6:
obj.logical_id += (None,) * (6 - len(obj.logical_id))
......@@ -778,7 +778,7 @@ class Disk(ConfigObject):
"""
if self.dev_type == constants.DT_PLAIN:
val = "<LogicalVolume(/dev/%s/%s" % self.logical_id
elif self.dev_type in constants.LDS_DRBD:
elif self.dev_type in constants.DTS_DRBD:
node_a, node_b, port, minor_a, minor_b = self.logical_id[:5]
val = "<DRBD8("
if self.physical_id is None:
......@@ -1092,7 +1092,7 @@ class Instance(TaggableObject):
"""
def _Helper(nodes, device):
"""Recursively computes nodes given a top device."""
if device.dev_type in constants.LDS_DRBD:
if device.dev_type in constants.DTS_DRBD:
nodea, nodeb = device.logical_id[:2]
nodes.add(nodea)
nodes.add(nodeb)
......@@ -1150,7 +1150,7 @@ class Instance(TaggableObject):
if dev.dev_type == constants.DT_PLAIN:
lvmap[node_uuid].append(dev.logical_id[0] + "/" + dev.logical_id[1])
elif dev.dev_type in constants.LDS_DRBD:
elif dev.dev_type in constants.DTS_DRBD:
if dev.children:
self.MapLVsByNode(lvmap, dev.children, dev.logical_id[0])
self.MapLVsByNode(lvmap, dev.children, dev.logical_id[1])
......
......@@ -393,7 +393,7 @@ class Merger(object):
# Update the DRBD port assignments
# This is a little bit hackish
for dsk in instance_info.disks:
if dsk.dev_type in constants.LDS_DRBD:
if dsk.dev_type in constants.DTS_DRBD:
port = my_config.AllocatePort()
logical_id = list(dsk.logical_id)
......
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