fix(exporter): drop dead bmc_event_summary field, fix status loss for inspur CPU/GPU
bmc_event_summary was a derived Assert/Deassert summary added in 4409594
alongside real fixes for GPU fault handling. It's not part of the Reanimator
hardware-ingest contract (event_logs is the only accepted log channel) and
was silently dropped on import — pure dead weight, removed.
Three related status bugs surfaced while auditing converted exports against
the contract, all specific to Inspur/onekeylog dumps:
- CPU status from RESTful CPU info was parsed but never assigned to
models.CPU, and was skipped entirely whenever asset.json already supplied
a CPU list (its own inventory has no status field) — CPUs always exported
as Unknown even when the source reported OK.
- PCIe device status (RESTful "status": 1) was parsed but never mapped onto
models.PCIeDevice, so RESTful-only devices always lost status.
- For GPUs specifically, asset.go emits two device records per physical GPU
(a generic pcie_devices entry enriched with real status, and a separate
gpus entry with a resolved model name but no status). dedupePCIe picks a
single winner by quality score, and a better model name outweighed having
a real status — the winner kept "Unknown" even when a losing duplicate had
the real value. dedupePCIe now backfills status onto the winner from a
losing duplicate when the winner's is Unknown.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
0867123a91
commit
42cfa3aa94
+12
@@ -189,6 +189,7 @@ func ParsePCIeDevices(content []byte) []models.PCIeDevice {
|
||||
MaxLinkSpeed: maxSpeed,
|
||||
PartNumber: partNumber,
|
||||
SerialNumber: strings.TrimSpace(pcie.SerialNum),
|
||||
Status: pcieRESTStatus(pcie.Status),
|
||||
}
|
||||
|
||||
devices = append(devices, device)
|
||||
@@ -197,6 +198,17 @@ func ParsePCIeDevices(content []byte) []models.PCIeDevice {
|
||||
return devices
|
||||
}
|
||||
|
||||
// pcieRESTStatus maps the RESTful PCIE Device info "status" flag (1 = OK) to
|
||||
// the shared status vocabulary. Only the observed OK case is mapped — the
|
||||
// meaning of other values isn't confirmed in the source, so it's left
|
||||
// unknown rather than guessed.
|
||||
func pcieRESTStatus(status int) string {
|
||||
if status == 1 {
|
||||
return "OK"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var rawHexDeviceNameRegex = regexp.MustCompile(`(?i)^0x[0-9a-f]+$`)
|
||||
|
||||
func sanitizePCIeDeviceName(name string) string {
|
||||
|
||||
Reference in New Issue
Block a user