mirror of
https://github.com/nicolargo/glances.git
synced 2024-11-28 14:12:21 +03:00
Crash on startup: KeyError: 'hz_actual_raw' on Raspbian 9.1 #1170
This commit is contained in:
parent
5568278752
commit
9d16fbb74c
1
NEWS
1
NEWS
@ -19,6 +19,7 @@ Bugs corrected:
|
||||
* glances_plugin.py has a problem with specific docker output #1160
|
||||
* Key error 'address' in the IP plugin #1176
|
||||
* NameError: name 'mode' is not defined in case of interrupt shortly after starting the server mode #1175
|
||||
* Crash on startup: KeyError: 'hz_actual_raw' on Raspbian 9.1 #1170
|
||||
|
||||
Backward-incompatible changes:
|
||||
|
||||
|
@ -81,9 +81,11 @@ class Plugin(GlancesPlugin):
|
||||
cpu_info = cpuinfo.get_cpu_info()
|
||||
# Check cpu_info (issue #881)
|
||||
if cpu_info is not None:
|
||||
self.stats['cpu_name'] = cpu_info['brand']
|
||||
self.stats['cpu_hz_current'] = cpu_info['hz_actual_raw'][0]
|
||||
self.stats['cpu_hz'] = cpu_info['hz_advertised_raw'][0]
|
||||
self.stats['cpu_name'] = cpu_info.get('brand', 'CPU')
|
||||
if 'hz_actual_raw' in cpu_info:
|
||||
self.stats['cpu_hz_current'] = cpu_info['hz_actual_raw'][0]
|
||||
if 'hz_advertised_raw' in cpu_info:
|
||||
self.stats['cpu_hz'] = cpu_info['hz_advertised_raw'][0]
|
||||
|
||||
return self.stats
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user