Return information about the logical volume(s)

    CLI Examples:

    .. code-block:: bash


        salt '*' lvm.lvresize +12M /dev/mapper/vg1-test
        salt '*' lvm.lvresize lvpath=/dev/mapper/vg1-test extents=+100%FREE

def lvresize(size=None, lvpath=None, extents=None):
    '''
    Return information about the logical volume(s)

    CLI Examples:

    .. code-block:: bash


        salt '*' lvm.lvresize +12M /dev/mapper/vg1-test
        salt '*' lvm.lvresize lvpath=/dev/mapper/vg1-test extents=+100%FREE

    '''
    if size and extents:
        log.error('Error: Please specify only one of size or extents')
        return {}

    cmd = ['lvresize']

    if size:
        cmd.extend(['-L', '{0}'.format(size)])
    elif extents:
        cmd.extend(['-l', '{0}'.format(extents)])
    else:
        log.error('Error: Either size or extents must be specified')
        return {}

    cmd.append(lvpath)
    cmd_ret = __salt__['cmd.run'](cmd, python_shell=False).splitlines()
    return {'Output from lvresize': cmd_ret[0].strip()}