mirror of https://git.48k.eu/ogclient
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.master
parent
7874323d46
commit
64f1f5403e
|
@ -35,7 +35,7 @@ def get_partition_data(device):
|
||||||
try:
|
try:
|
||||||
cxt = fdisk.Context(device=device, details=True)
|
cxt = fdisk.Context(device=device, details=True)
|
||||||
except Exception as e:
|
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):
|
for i, p in enumerate(cxt.partitions):
|
||||||
pd = ogPartitionData(
|
pd = ogPartitionData(
|
||||||
|
@ -51,7 +51,7 @@ def get_disk_data(device):
|
||||||
try:
|
try:
|
||||||
cxt = fdisk.Context(device=device, details=True)
|
cxt = fdisk.Context(device=device, details=True)
|
||||||
except Exception as e:
|
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(
|
return ogDiskData(
|
||||||
nsectors = cxt.nsectors,
|
nsectors = cxt.nsectors,
|
||||||
sector_size = cxt.sector_size,
|
sector_size = cxt.sector_size,
|
||||||
|
|
Loading…
Reference in New Issue