From 74af0b2805d98c4b3a42eeed98c87b8e9ce03b92 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Mon, 3 Mar 2025 17:16:25 -0500 Subject: [PATCH] Fixed Regex for _is_physical_disk --- hwmonDaemon.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hwmonDaemon.py b/hwmonDaemon.py index d857331..1d22c9f 100644 --- a/hwmonDaemon.py +++ b/hwmonDaemon.py @@ -309,12 +309,12 @@ class SystemHealthMonitor: :return: Boolean indicating if it's a relevant physical disk """ # Strip partition numbers to get base device - base_device = re.sub(r'\d+$', '', device_path) - - excluded_mounts = ['/boot', '/boot/efi'] - if any(device_path.startswith(mount) for mount in excluded_mounts): - return False - return bool(re.match(r'/dev/(sd[a-z]|nvme\d+n\d+|mmcblk\d+)$', base_device)) + base_device = re.sub(r'\d+', '', device_path) + excluded_mounts = ['/boot', '/boot/efi'] + if any(device_path.startswith(mount) for mount in excluded_mounts): + return False + return bool(re.match(r'/dev/(sd[a-z]|nvme\d+n\d+|mmcblk\d+)', base_device)) + def _check_disk_firmware(self, device: str) -> Dict[str, Any]: """