mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
M #-: Fix CPU capacity
For some versions of lscpu scaling is also returned in the form: CPU(s): 8 CPU(s) scaling MHz: 55% So /CPU\(s\)/ matches both lines and the TOTAL_CPU value is not properly computed (cherry picked from commit 62c265b5028395a929ca50505886a6c595b70fa2)
This commit is contained in:
parent
8d3c11de75
commit
7967ffd714
@ -44,7 +44,7 @@ class LinuxHost
|
||||
@net = {}
|
||||
|
||||
cpuinfo.split(/\n/).each do |line|
|
||||
if line =~ /^CPU\(s\)/
|
||||
if line =~ /^CPU\(s\):/
|
||||
@cpu[:total] = line.split(':')[1].strip.to_i * 100
|
||||
elsif line =~ /^CPU MHz:/
|
||||
@cpu[:speed] = Float(line.split(':')[1].strip.split(' ')[0]).round
|
||||
|
Loading…
x
Reference in New Issue
Block a user