diff --git a/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/libraries/scan_layout.py b/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/libraries/scan_layout.py index f51bcda429..301265e3bf 100644 --- a/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/libraries/scan_layout.py +++ b/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/libraries/scan_layout.py @@ -59,14 +59,6 @@ def get_partition_layout(device): # of the msg. Let's improve it in future if we find a reason for it. return None - for line in table_iter: - line = line.strip() - if not line.startswith('Device'): - continue - - part_all_attrs = split_on_space_segments(line) - break - partitions = [] for partition_line in table_iter: # Fields: Device Boot Start End Sectors Size Id Type @@ -75,7 +67,7 @@ def get_partition_layout(device): # If the partition is not bootable, the Boot column might be empty part_device = part_info[0] - part_start = int(part_info[2]) if len(part_info) == len(part_all_attrs) else int(part_info[1]) + part_start = int(part_info[2]) if part_info[1] == '*' else int(part_info[1]) partitions.append(PartitionInfo(part_device=part_device, start_offset=part_start*unit)) return GRUBDevicePartitionLayout(device=device, partitions=partitions) diff --git a/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/tests/test_scan_partition_layout.py b/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/tests/test_scan_partition_layout.py index 5402537980..a5424b59c2 100644 --- a/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/tests/test_scan_partition_layout.py +++ b/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/tests/test_scan_partition_layout.py @@ -45,7 +45,7 @@ def test_get_partition_layout(monkeypatch, devices): ' Device Boot Start End Blocks Id System', ] for part in device.partitions: - part_line = '{0} * {1} 2099199 1048576 83 Linux'.format(part.name, part.start_offset) + part_line = '{0} * {1} 2099199 1048576 83 Linux raid autodetect'.format(part.name, part.start_offset) fdisk_output.append(part_line) device_to_fdisk_output[device.name] = fdisk_output