the code has been moved outside the loop.
Signed-off-by: Yalcin Ozbek <yalcinozbekceng@gmail.com>
This commit is contained in:
parent
13f00fde46
commit
4314a0567b
|
@ -244,16 +244,6 @@ func InfoWithContext(ctx context.Context) ([]InfoStat, error) {
|
|||
c.Model = value
|
||||
case "model name", "cpu":
|
||||
c.ModelName = value
|
||||
if c.VendorID == "ARM" && c.ModelName == "" {
|
||||
if v, err := strconv.ParseUint(c.Model, 0, 16); err == nil {
|
||||
modelName, exist := armModelToModelName[v]
|
||||
if exist {
|
||||
c.ModelName = modelName
|
||||
} else {
|
||||
c.ModelName = "Undefined"
|
||||
}
|
||||
}
|
||||
}
|
||||
if strings.Contains(value, "POWER8") ||
|
||||
strings.Contains(value, "POWER7") {
|
||||
c.Model = strings.Split(value, " ")[0]
|
||||
|
@ -299,6 +289,16 @@ func InfoWithContext(ctx context.Context) ([]InfoStat, error) {
|
|||
finishCPUInfo(&c)
|
||||
ret = append(ret, c)
|
||||
}
|
||||
if c.VendorID == "ARM" && c.ModelName == "" {
|
||||
if v, err := strconv.ParseUint(c.Model, 0, 16); err == nil {
|
||||
modelName, exist := armModelToModelName[v]
|
||||
if exist {
|
||||
c.ModelName = modelName
|
||||
} else {
|
||||
c.ModelName = "Undefined"
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue