Debug logs for is_physical_disk

This commit is contained in:
2025-03-03 17:18:35 -05:00
parent c1f37d11af
commit 358baac048

View File

@ -308,12 +308,18 @@ class SystemHealthMonitor:
:param device_path: Path to the device :param device_path: Path to the device
: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 logger.debug(f"Checking device: {device_path}")
base_device = re.sub(r'\d+', '', device_path) base_device = re.sub(r'\d+', '', device_path)
logger.debug(f"Base device after stripping numbers: {base_device}")
excluded_mounts = ['/boot', '/boot/efi'] excluded_mounts = ['/boot', '/boot/efi']
if any(device_path.startswith(mount) for mount in excluded_mounts): if any(device_path.startswith(mount) for mount in excluded_mounts):
logger.debug(f"Device {device_path} excluded due to mount point")
return False return False
return bool(re.match(r'/dev/(sd[a-z]|nvme\d+n\d+|mmcblk\d+)', base_device))
is_physical = bool(re.match(r'/dev/(sd[a-z]|nvme\d+n\d+|mmcblk\d+)', base_device))
logger.debug(f"Device {device_path} physical disk check result: {is_physical}")
return is_physical
def _check_disk_firmware(self, device: str) -> Dict[str, Any]: def _check_disk_firmware(self, device: str) -> Dict[str, Any]: