#NEWLINE# def resize( device , minor , start , end ) : #NEWLINE# #INDENT# "\n    Resizes the partition with number <minor>.\n\n    The partition will start <start> from the beginning of the disk, and end\n    <end> from the beginning of the disk. resize never changes the minor number.\n    Extended partitions can be resized, so long as the new extended partition\n    completely contains all logical partitions.\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' partition.resize /dev/sda 3 200 850\n    " #NEWLINE# _validate_device ( end ) #NEWLINE# try : #NEWLINE# #INDENT# int ( minor ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# raise CommandExecutionError ( 'Invalid minor number passed to partition.resize' ) #NEWLINE# #UNINDENT# _validate_partition_boundary ( start ) #NEWLINE# _validate_partition_boundary ( end ) #NEWLINE# out = __salt__ [ 'cmd.run' ] ( 'parted -m -s -- {0} resize {1} {2} {3}' . format ( device , minor , start , end ) ) #NEWLINE# return out . splitlines ( )