From 9a9a98edf72cba9864b42ff738646278aa2dddc5 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Fri, 5 Jul 2024 22:56:08 +0800 Subject: [PATCH] Fix "Unknown" RAM size - "Unknown" isn't an int --- agent.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/agent.py b/agent.py index 3647b4f..7e25a09 100644 --- a/agent.py +++ b/agent.py @@ -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')