From a53639408e60163f171fca54e4f33952372a5df8 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Thu, 5 Oct 2023 19:08:02 +0200 Subject: [PATCH] v0.10.3 --- setup.cfg | 2 +- src/de/p1st/monitor/loggers/drive.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index 6454d7f..68cd0de 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,7 @@ [metadata] name = de.p1st.monitor -version = 0.10.2 +version = 0.10.3 author = Daniel Langbein author_email = daniel@systemli.org description = periodically monitor and warn diff --git a/src/de/p1st/monitor/loggers/drive.py b/src/de/p1st/monitor/loggers/drive.py index 978de56..f51c60c 100644 --- a/src/de/p1st/monitor/loggers/drive.py +++ b/src/de/p1st/monitor/loggers/drive.py @@ -96,11 +96,14 @@ class DriveLogger(Logger): :raise BlkidException: If UUID could not be determined. """ returncode, stdout, stderr = execute_capture(['blkid', '-s', 'UUID', '-o', 'value', f'{device}']) - if returncode != 0: raise BlkidException(f'blkid failed with returncode {returncode}\nstdout: {stdout}\nstderr: {stderr}') - return stdout.strip() + uuid = stdout.strip() + if len(uuid) == 0: + raise BlkidException('blkid had exit code zero, but the UUID is empty') + + return uuid @classmethod def get_temp_from_device(cls, device: Path) -> int: