diff --git a/NEWS b/NEWS index 7792db33..850aab76 100644 --- a/NEWS +++ b/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: diff --git a/glances/plugins/glances_quicklook.py b/glances/plugins/glances_quicklook.py index 2a1b5b63..46b346e6 100644 --- a/glances/plugins/glances_quicklook.py +++ b/glances/plugins/glances_quicklook.py @@ -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