Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPU 7 -> 8: scangrubdevpartitionlayout: Skip warning msgs #1306

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ def get_partition_layout(device):

partitions = []
for partition_line in table_iter:
if not partition_line.startswith('/'):
# the output can contain warning msg when a partition is not aligned
# on physical sector boundary, like:
# ~~~
# Partition 4 does not start on physical sector boundary.
# ~~~
# We know that in case of MBR the line we expect to parse always
# starts with canonical path. So let's use this condition.
# See https://issues.redhat.com/browse/RHEL-50947
continue
# Fields: Device Boot Start End Sectors Size Id Type
# The line looks like: `/dev/vda1 * 2048 2099199 2097152 1G 83 Linux`
part_info = split_on_space_segments(partition_line)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ def test_get_partition_layout(monkeypatch, devices, fs):
part_line = '{0} * {1} 2099199 1048576 83 {2}'.format(part.name, part.start_offset, fs)
fdisk_output.append(part_line)

# add a problematic warning msg to test:
# https://issues.redhat.com/browse/RHEL-50947
fdisk_output.append('Partition 3 does not start on physical sector boundary.')
device_to_fdisk_output[device.name] = fdisk_output

def mocked_run(cmd, *args, **kwargs):
Expand Down