Fixed Regex for _is_physical_disk

This commit is contained in:
2025-03-03 17:16:25 -05:00
parent ae473b387e
commit 74af0b2805

View File

@ -309,12 +309,12 @@ class SystemHealthMonitor:
:return: Boolean indicating if it's a relevant physical disk :return: Boolean indicating if it's a relevant physical disk
""" """
# Strip partition numbers to get base device # Strip partition numbers to get base device
base_device = re.sub(r'\d+$', '', device_path) 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))
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]: def _check_disk_firmware(self, device: str) -> Dict[str, Any]:
""" """