[PATCH 4/5] Add support for listing everything to pvinfo and lvs.

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


On Fri, 2014-03-28 at 15:32 -0500, David Lehman wrote:
> Specifying a device to pvinfo or a vg_name to lvs will filter the
> results as expected.
> ---
>  blivet/devicelibs/lvm.py | 52 +++++++++++++++++++++++++++++++++++++-----------
>  blivet/devicetree.py     |  3 ++-
>  2 files changed, 42 insertions(+), 13 deletions(-)
> 
> diff --git a/blivet/devicelibs/lvm.py b/blivet/devicelibs/lvm.py
> index cccf951..74fe93b 100644
> --- a/blivet/devicelibs/lvm.py
> +++ b/blivet/devicelibs/lvm.py
> @@ -289,8 +289,15 @@ def parse_lvm_vars(line):
>  
>      return info
>  
> -def pvinfo(device):
> -    """
> +def pvinfo(device=None):
> +    """ Return a dict with information about LVM PVs.
> +
> +        :keyword str device: path to PV device node (optional)
> +        :returns: dict containing PV path keys and udev info dict values
> +        :rtype: dict
> +
> +        If device is None we let LVM report on all known PVs.
> +
>          If the PV was created with '--metadacopies 0', lvm will do some
>          scanning of devices to determine from their metadata which VG
>          this PV belongs to.
> @@ -301,16 +308,23 @@ def pvinfo(device):
>      args = ["pvs",
>              "--unit=k", "--nosuffix", "--nameprefixes",
>              "--unquoted", "--noheadings",
> -            "-opv_uuid,pe_start,vg_name,vg_uuid,vg_size,vg_free,vg_extent_size,vg_extent_count,vg_free_count,pv_count"] + \
> -            _getConfigArgs(read_only_locking=True) + \
> -            [device]
> +            "-opv_name,pv_uuid,pe_start,vg_name,vg_uuid,vg_size,vg_free,vg_extent_size,vg_extent_count,vg_free_count,pv_count"] + \
Could you please split this long string into two on two lines?

-- 
Vratislav Podzimek

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



More information about the anaconda-patches mailing list