adjust regex

This commit is contained in:
2025-03-09 22:09:24 -04:00
parent 8f87403d48
commit 6a6a400320

View File

@ -785,7 +785,8 @@ class SystemHealthMonitor:
size_str = size_str.strip().upper()
match = re.match(r'^([\d.]+)\s*([KMGT])B?$', size_str)
# Match size with optional decimal and unit
match = re.match(r'^([\d.]+)\s*([KMGT]B?)?$', size_str)
if match:
value = float(match.group(1))
unit = match.group(2)
@ -794,13 +795,18 @@ class SystemHealthMonitor:
'K': 1024,
'M': 1024**2,
'G': 1024**3,
'T': 1024**4
'T': 1024**4,
'KB': 1024,
'MB': 1024**2,
'GB': 1024**3,
'TB': 1024**4
}
return value * multipliers.get(unit, 1) # Default to 1 for bytes
return 0.0
def _is_physical_disk(self, device_path):
"""
Check if the device is a physical disk, excluding logical volumes and special devices.