LGTM, thanks.

On Mon, Oct 7, 2013 at 2:30 PM, Helga Velroyen <[email protected]> wrote:

> 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: Helga Velroyen <[email protected]>
> ---
>  lib/cmdlib/instance.py       |  2 +-
>  lib/cmdlib/instance_query.py |  2 +-
>  lib/cmdlib/instance_utils.py |  2 +-
>  lib/config.py                |  2 +-
>  lib/constants.py             |  6 +++---
>  lib/objects.py               | 12 ++++++------
>  tools/cluster-merge          |  2 +-
>  7 files changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/lib/cmdlib/instance.py b/lib/cmdlib/instance.py
> index b57d586..5110036 100644
> --- a/lib/cmdlib/instance.py
> +++ b/lib/cmdlib/instance.py
> @@ -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):
> diff --git a/lib/cmdlib/instance_query.py b/lib/cmdlib/instance_query.py
> index 5c55c7b..ee9ba13 100644
> --- a/lib/cmdlib/instance_query.py
> +++ b/lib/cmdlib/instance_query.py
> @@ -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]
> diff --git a/lib/cmdlib/instance_utils.py b/lib/cmdlib/instance_utils.py
> index 0092c67..f4bfa09 100644
> --- a/lib/cmdlib/instance_utils.py
> +++ b/lib/cmdlib/instance_utils.py
> @@ -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:
> diff --git a/lib/config.py b/lib/config.py
> index 7fb136b..8542a15 100644
> --- a/lib/config.py
> +++ b/lib/config.py
> @@ -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] = []
> diff --git a/lib/constants.py b/lib/constants.py
> index 939a729..c761023 100644
> --- a/lib/constants.py
> +++ b/lib/constants.py
> @@ -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"
> diff --git a/lib/objects.py b/lib/objects.py
> index bf25deb..4c5d785 100644
> --- a/lib/objects.py
> +++ b/lib/objects.py
> @@ -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])
> diff --git a/tools/cluster-merge b/tools/cluster-merge
> index 04e08cf..f6bd138 100755
> --- a/tools/cluster-merge
> +++ b/tools/cluster-merge
> @@ -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)
> --
> 1.8.4
>
>


-- 
Thomas Thrainer | Software Engineer | [email protected] |

Google Germany GmbH
Dienerstr. 12
80331 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Christine Elizabeth Flores

Reply via email to