mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
fix(baremetal): skip 'Volatile Size' line when detecting memory size
This commit is contained in:
@@ -162,6 +162,10 @@ func ParseDMIMemInfo(lines []string) *types.SDMIMemInfo {
|
||||
if val == nil {
|
||||
continue
|
||||
}
|
||||
// skip 'Volatile Size:' line
|
||||
if strings.Contains(line, "Volatile") {
|
||||
continue
|
||||
}
|
||||
value := strings.ToLower(*val)
|
||||
if strings.HasSuffix(value, " mb") {
|
||||
sizeMb, err := strconv.Atoi(strings.TrimSuffix(value, " mb"))
|
||||
|
||||
Reference in New Issue
Block a user