From d56d72d78522e213e7d1bb49fdd890adcae24145 Mon Sep 17 00:00:00 2001 From: "M. Rehan" Date: Tue, 23 Apr 2024 19:35:07 +0500 Subject: [PATCH] Add ability to detect iX CI VMs --- ixhardware/chassis.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ixhardware/chassis.py b/ixhardware/chassis.py index 81ff4df..686b146 100644 --- a/ixhardware/chassis.py +++ b/ixhardware/chassis.py @@ -16,6 +16,7 @@ "TRUENAS-R", # freenas certified replacement "FREENAS-MINI", # minis tagged with legacy information ) +TRUENAS_QEMU = "IXKVM" TRUENAS_UNKNOWN = "TRUENAS-UNKNOWN" @@ -29,4 +30,9 @@ def get_chassis_hardware(dmi: DMIInfo): # last resort return "TRUENAS-X" + if dmi.system_product_name == "qemu" and dmi.system_serial_number.startswith( + "ha" + ) and dmi.system_serial_number.endswith(("_c1", "_c2")): + return TRUENAS_QEMU + return TRUENAS_UNKNOWN