Resizes the partition with number <minor>.

    The partition will start <start> from the beginning of the disk, and end
    <end> from the beginning of the disk. resize never changes the minor number.
    Extended partitions can be resized, so long as the new extended partition
    completely contains all logical partitions.

    CLI Example:

    .. code-block:: bash

        salt '*' partition.resize /dev/sda 3 200 850

def resize(device, minor, start, end):
    '''
    Resizes the partition with number <minor>.

    The partition will start <start> from the beginning of the disk, and end
    <end> from the beginning of the disk. resize never changes the minor number.
    Extended partitions can be resized, so long as the new extended partition
    completely contains all logical partitions.

    CLI Example:

    .. code-block:: bash

        salt '*' partition.resize /dev/sda 3 200 850
    '''
    _validate_device(device)

    try:
        int(minor)
    except Exception:
        raise CommandExecutionError(
            'Invalid minor number passed to partition.resize'
        )

    _validate_partition_boundary(start)
    _validate_partition_boundary(end)

    out = __salt__['cmd.run'](
        'parted -m -s -- {0} resize {1} {2} {3}'.format(
            device, minor, start, end
        )
    )
    return out.splitlines()