Skip to content

Commit

Permalink
skip the empty slots & handle the out of spec memory type
Browse files Browse the repository at this point in the history
  • Loading branch information
Omarabdul3ziz committed Nov 4, 2024
1 parent b8e2b4a commit 908ea83
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions grid-proxy/internal/indexer/dmi.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import (

const (
DmiCallCmd = "zos.system.dmi"

outOfSpec = "<OUT OF SPEC>"
unknown = "Unknown"
other = "Other"
)

type DMIWork struct {
Expand Down Expand Up @@ -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,
})
}
Expand Down

0 comments on commit 908ea83

Please # to comment.