mirror of
https://github.com/nicolargo/glances.git
synced 2024-10-26 20:26:58 +03:00
Merge remote-tracking branch 'origin/2616-raspberry-pi-cpu-info-is-not-correct' into develop
This commit is contained in:
commit
be89ee0025
@ -65,7 +65,7 @@ class CpuPercent:
|
||||
|
||||
def __get_cpu_name(self):
|
||||
# Get the CPU name once from the /proc/cpuinfo file
|
||||
# Read the first line with the "model name"
|
||||
# Read the first line with the "model name" ("Model" for Raspberry Pi)
|
||||
ret = None
|
||||
try:
|
||||
cpuinfo_file = open('/proc/cpuinfo').readlines()
|
||||
@ -73,7 +73,7 @@ class CpuPercent:
|
||||
pass
|
||||
else:
|
||||
for line in cpuinfo_file:
|
||||
if line.startswith('model name'):
|
||||
if line.startswith('model name') or line.startswith('Model'):
|
||||
ret = line.split(':')[1].strip()
|
||||
break
|
||||
return ret if ret else 'CPU'
|
||||
|
Loading…
Reference in New Issue
Block a user