Fix "Unknown" RAM size

- "Unknown" isn't an int
This commit is contained in:
Peter Šurda 2024-07-05 22:56:08 +08:00
parent 601bed9a34
commit 9a9a98edf7
Signed by: PeterSurda
GPG Key ID: 3E47497CF67ABB95

View File

@ -295,8 +295,14 @@ class ServerData:
size = ram.get('Size', 'Unknown')
speed = ram.get('Speed', 'Unknown')
configured_speed = ram.get('Configured Memory Speed', 'Unknown')
total_width = int(ram.get('Total Width', "0").split()[0])
data_width = int(ram.get('Data Width', "0").split()[0])
try:
total_width = int(ram.get('Total Width', "0").split()[0])
except ValueError:
total_width = 0
try:
data_width = int(ram.get('Data Width', "0").split()[0])
except ValueError:
data_width = 0
ecc = 'Yes' if total_width > data_width else 'No'
serial_number = ram.get('Serial Number', 'Unknown')
ram_type = ram.get('Type', 'Unknown')