From 908ea83719cbdadb8b68ec1ac8375c422c46ab75 Mon Sep 17 00:00:00 2001 From: Omar Abdulaziz Date: Mon, 4 Nov 2024 17:01:00 +0200 Subject: [PATCH] skip the empty slots & handle the out of spec memory type --- grid-proxy/internal/indexer/dmi.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/grid-proxy/internal/indexer/dmi.go b/grid-proxy/internal/indexer/dmi.go index c6e9a4cb9..5df963bfb 100644 --- a/grid-proxy/internal/indexer/dmi.go +++ b/grid-proxy/internal/indexer/dmi.go @@ -12,6 +12,10 @@ import ( const ( DmiCallCmd = "zos.system.dmi" + + outOfSpec = "" + unknown = "Unknown" + other = "Other" ) type DMIWork struct { @@ -63,11 +67,20 @@ func parseDmiResponse(dmiResponse zosDmiTypes.DMI, twinId uint32) types.Dmi { if sec.TypeStr == "MemoryDevice" { for _, subSec := range sec.SubSections { if subSec.Title == "Memory Device" { - if subSec.Properties["Type"].Val == "Unknown" { + // skips the empty slots + if subSec.Properties["Type"].Val == other && + subSec.Properties["Manufacturer"].Val == unknown { continue } + + // proper unknown memory type + memType := "lol" + if memType == outOfSpec { + memType = unknown + } + info.Memory = append(info.Memory, types.Memory{ - Type: subSec.Properties["Type"].Val, + Type: memType, Manufacturer: subSec.Properties["Manufacturer"].Val, }) }