From 64f1f5403e014a944e70187e6eda9a02c08eac3e Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Fri, 25 Oct 2024 09:25:51 +0200 Subject: disk: use different log message in get_disk_data and get_partition_data Use a more specific message to differentiate the source of the error. Add the target device to the log message. --- src/utils/disk.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/utils/disk.py') diff --git a/src/utils/disk.py b/src/utils/disk.py index 2af1462..0ba38dc 100644 --- a/src/utils/disk.py +++ b/src/utils/disk.py @@ -35,7 +35,7 @@ def get_partition_data(device): try: cxt = fdisk.Context(device=device, details=True) except Exception as e: - raise OgError(f'Partition query error: {e}') from e + raise OgError(f'Partition query error for {device}: {e}') from e for i, p in enumerate(cxt.partitions): pd = ogPartitionData( @@ -51,7 +51,7 @@ def get_disk_data(device): try: cxt = fdisk.Context(device=device, details=True) except Exception as e: - raise OgError(f'Partition query error: {e}') from e + raise OgError(f'Disk query error for {device}: {e}') from e return ogDiskData( nsectors = cxt.nsectors, sector_size = cxt.sector_size, -- cgit v1.2.3-18-g5258