Fixed Regex for _is_physical_disk
This commit is contained in:
@ -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)
|
||||
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]:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user