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: