(vgname=None)
return map(
        lambda l: {'pvname': l[0], 'size': int(l[1]), 'uuid': l[2]},
        [fields.split() for fields in pvs],
    )
lists all physical volumes in the system. It can be filtered by the
    volume group. All size units are in bytes.

    [{'pvname': '/dev/sda3',
      'size': 469502001152L,
      'uuid': 'kkon5B-vnFI-eKHn-I5cG-Hj0C-uGx0-xqZrXI'},
     {'pvname': '/dev/sda2',
      'size': 21470642176L,
      'uuid': 'CyBzhK-cQFl-gWqr-fyWC-A50Y-LMxu-iHiJq4'}]
lists all physical volumes in the system. It can be filtered by the
    volume group. All size units are in bytes.
lists all physical volumes in the system . It can be filtered by the volume group . All size units are in bytes .
def pvs(vgname=None):
    """
    lists all physical volumes in the system. It can be filtered by the
    volume group. All size units are in bytes.

    [{'pvname': '/dev/sda3',
      'size': 469502001152L,
      'uuid': 'kkon5B-vnFI-eKHn-I5cG-Hj0C-uGx0-xqZrXI'},
     {'pvname': '/dev/sda2',
      'size': 21470642176L,
      'uuid': 'CyBzhK-cQFl-gWqr-fyWC-A50Y-LMxu-iHiJq4'}]
    """
    cmd = [
        'pvs',
        '--units',
        'b',
        '--nosuffix',
        '--noheading',
        '--unbuffered',
        '--options',
        'pv_name,pv_size,pv_uuid,vg_name',
    ]

    out, err, rc = run_command(cmd)
    if rc != 0:
        raise OperationFailed('KCHDISK00004E', {'err': err})

    if not out:
        return []

    # remove blank spaces and create a list of PVs filtered by vgname, if
    # provided
    pvs = filter(
        lambda f: vgname is None or vgname in f,
        map(lambda v: v.strip(), out.strip('\n').split('\n')),
    )

    # create a dict based on data retrieved from pvs
    return map(
        lambda l: {'pvname': l[0], 'size': int(l[1]), 'uuid': l[2]},
        [fields.split() for fields in pvs],
    )
def pvs ( vgname = None ) : cmd = [ 'pvs' , '--units' , 'b' , '--nosuffix' , '--noheading' , '--unbuffered' , '--options' , 'pv_name,pv_size,pv_uuid,vg_name' , ] out , err , rc = run_command ( cmd ) if rc != 0 : raise OperationFailed ( 'KCHDISK00004E' , { 'err' : err } ) if not out : return [ ] # remove blank spaces and create a list of PVs filtered by vgname, if # provided pvs = filter ( lambda f : vgname is None or vgname in f , map ( lambda v : v . strip ( ) , out . strip ( '\n' ) . split ( '\n' ) ) , ) # create a dict based on data retrieved from pvs return map ( lambda l : { 'pvname' : l [ 0 ] , 'size' : int ( l [ 1 ] ) , 'uuid' : l [ 2 ] } , [ fields . split ( ) for fields in pvs ] , )