This commit is contained in:
Daniel Langbein 2023-10-05 19:08:02 +02:00
parent b5416a98ba
commit a53639408e
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002
2 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -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: