[PATCH 3/5] Get lv list from lvm in a more straightforward format.

Vratislav Podzimek vpodzime at redhat.com
Mon Mar 31 07:45:31 UTC 2014


On Fri, 2014-03-28 at 15:32 -0500, David Lehman wrote:

>  
> -        # make a list of indices with mirror volumes up front and snapshots at
> -        # the end
> -        indices = range(len(lv_names))
> -        indices.sort(key=lambda i: lv_attr[i], cmp=lv_attr_cmp)
> -        lv_real_names = [n.replace("[", "").replace("]", "") for n in lv_names]
>          raid = dict([("%s-%s" % (vg_device.name,
>                                   n.replace("[", "").replace("]", "")),
>                        {"copies": 0, "log": Size(bytes=0), "meta": Size(bytes=0)})
> -                     for n in lv_names])
> -        lv_data = zip(lv_names, lv_uuids, lv_attr, lv_sizes, lv_types)
> -        for i in range(len(lv_data)):
> -            addLV(*lv_data[i])
> +                     for n in lv_info.keys()])
You can drop those square brackets in the comprehension.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list