feat(models): resolve CPU serial from source PPIN as common fallback

Centralize CPU identity in models.ResolveCPUSerialNumber: an explicit
source serial wins, otherwise a valid source PPIN is used, placeholders
rejected. Dell, H3C and Redfish apply it while parsing; canonical-device
and Reanimator conversion apply it again at the output boundary. No
identity is synthesized from socket/model/board serial.

See ADL-058.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Mikhail Chusavitin
2026-08-27 17:05:40 +03:00
co-authored by Claude Sonnet 5
parent 9d701885da
commit 07c270cda2
13 changed files with 122 additions and 19 deletions
+4 -2
View File
@@ -19,7 +19,7 @@ import (
"git.mchus.pro/mchus/logpile/internal/parser/vendors/pciids"
)
const parserVersion = "3.0"
const parserVersion = "3.1"
func init() {
parser.Register(&Parser{})
@@ -323,6 +323,7 @@ func parseCPUView(props map[string]string, result *models.AnalysisResult) {
if model == "" {
return
}
ppin := strings.TrimSpace(props["ppin"])
cpu := models.CPU{
Socket: parseSocketFromFQDD(firstNonEmpty(props["fqdd"], props["instanceid"])),
Model: model,
@@ -331,7 +332,8 @@ func parseCPUView(props map[string]string, result *models.AnalysisResult) {
Threads: parseIntLoose(props["numberofenabledthreads"]),
FrequencyMHz: parseIntLoose(props["currentclockspeed"]),
MaxFreqMHz: parseIntLoose(props["maxclockspeed"]),
PPIN: strings.TrimSpace(props["ppin"]),
PPIN: ppin,
SerialNumber: models.ResolveCPUSerialNumber(props["serialnumber"], ppin),
Status: normalizeStatus(props["primarystatus"]),
}
result.Hardware.CPUs = append(result.Hardware.CPUs, cpu)