From c3a3d80ea51f48b7f5a5f30e60992a12a7c4a32d Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Fri, 2 Aug 2019 14:27:43 -0700 Subject: [PATCH] storage: yapf changes Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- actions/storage | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/actions/storage b/actions/storage index 292cc7cfe..648f94657 100755 --- a/actions/storage +++ b/actions/storage @@ -78,15 +78,18 @@ def subcommand_expand_partition(arguments): def _resize_partition(device, requested_partition, free_space): """Resize the partition table entry.""" - command = ['parted', '--align=optimal', '--script', device, 'unit', 'B', - 'resizepart', requested_partition['number'], - str(free_space['end'])] + command = [ + 'parted', '--align=optimal', '--script', device, 'unit', 'B', + 'resizepart', requested_partition['number'], + str(free_space['end']) + ] # XXX: Remove workaround after bug in parted is fixed: # https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24215 - fallback_command = ['parted', '--align=optimal', device, - '---pretend-input-tty', 'unit', 'B', 'resizepart', - requested_partition['number'], 'yes', - str(free_space['end'])] + fallback_command = [ + 'parted', '--align=optimal', device, '---pretend-input-tty', 'unit', + 'B', 'resizepart', requested_partition['number'], 'yes', + str(free_space['end']) + ] try: subprocess.run(command, check=True) except subprocess.CalledProcessError as exception: @@ -107,8 +110,8 @@ def _resize_file_system(device, requested_partition, free_space): def _resize_ext4(device, requested_partition, free_space): """Resize an ext4 file system inside a partition.""" - partition_device = _get_partition_device( - device, requested_partition['number']) + partition_device = _get_partition_device(device, + requested_partition['number']) try: command = ['resize2fs', partition_device] subprocess.run(command, stdout=subprocess.DEVNULL, @@ -191,8 +194,9 @@ def _get_root_device_and_partition_number(device): def _get_partitions_and_free_spaces(device, partition_number): """Run parted and return list of partitions and free spaces.""" - command = ['parted', '--machine', '--script', device, 'unit', 'B', - 'print', 'free'] + command = [ + 'parted', '--machine', '--script', device, 'unit', 'B', 'print', 'free' + ] process = subprocess.run(command, stdout=subprocess.PIPE, check=True) requested_partition = None