[PATCH 1/2] Add required LVs as needed instead of trying to sort by attrs.

Brian C. Lane bcl at redhat.com
Mon Mar 31 23:41:25 UTC 2014


On Mon, Mar 31, 2014 at 01:10:12PM -0500, David Lehman wrote:
> @@ -1399,6 +1379,7 @@ class DeviceTree(object):
>                  # mirror image
>                  rname = re.sub(r'_[rm]image.+', '', lv_name[1:-1])
>                  name = "%s-%s" % (vg_name, rname)
> +                addRequiredLV(name, "failed to look up raid lv")
>                  raid[name]["copies"] += 1
>                  return
>              elif lv_attr[0] == 'e':
> @@ -1409,12 +1390,14 @@ class DeviceTree(object):
>                  # raid metadata volume
>                  lv_name = re.sub(r'_rmeta.+', '', lv_name[1:-1])
>                  name = "%s-%s" % (vg_name, lv_name)
> +                addRequiredLV(name, "failed to look up raid lv")
>                  raid[name]["meta"] += lv_size
>                  return
>              elif lv_attr[0] == 'l':
>                  # log volume
>                  rname = re.sub(r'_mlog.*', '', lv_name[1:-1])
>                  name = "%s-%s" % (vg_name, rname)
> +                addRequiredLV(name, "failed to look up log lv")
>                  raid[name]["log"] = lv_size
>                  return
>              elif lv_attr[0] == 't':
> @@ -1424,17 +1407,9 @@ class DeviceTree(object):
>                  # thin volume
>                  pool_name = devicelibs.lvm.thinlvpoolname(vg_name, lv_name)
>                  pool_device_name = "%s-%s" % (vg_name, pool_name)
> -                pool_device = self.getDeviceByName(pool_device_name)
> -                if pool_device is None:
> -                    plv = lv_info[pool_device_name]
> -                    addLV(plv)
> -                    pool_device = self.getDeviceByName(pool_device_name)
> -
> -                if pool_device is None:
> -                    raise DeviceTreeError("failed to look up thin pool")
> -
> +                addRequiredLV(pool_device_name, "failed to look up thin pool")

Should these log the name when they fail? Or is that going to be obvious
from surrounding log messages?

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list