diff --git a/NEWS b/NEWS index aa099eeb..1ce3bfec 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ Enhancements and new features: * Prohibit some plug-in data from being exported to influxdb #1368 * Disable plugin from Glances configuration file #1378 * Curses-browser's server list paging added (thanks to @limfreee) #1385 + * Client Browser's thread management added (thanks to @limfreee) #1391 Bugs corrected: @@ -30,6 +31,7 @@ Bugs corrected: * Create an option to set the username to use in Web or RPC Server mode #1381 * Missing kernel task names when the webui is switched to long process names #1371 * Drive name with special characters causes crash #1383 + * Cannot get stats in Cloud plugin (404) #1384 Others: diff --git a/glances/plugins/glances_cloud.py b/glances/plugins/glances_cloud.py index 0084255f..fd5ac6c9 100644 --- a/glances/plugins/glances_cloud.py +++ b/glances/plugins/glances_cloud.py @@ -89,12 +89,13 @@ class Plugin(GlancesPlugin): # Update the stats if self.input_method == 'local': + stats = self.OPENSTACK.stats # Example: + # Uncomment to test on physical computer # stats = {'ami-id': 'ami-id', # 'instance-id': 'instance-id', # 'instance-type': 'instance-type', # 'region': 'placement/availability-zone'} - stats = self.OPENSTACK.stats # Update the stats self.stats = stats @@ -115,9 +116,9 @@ class Plugin(GlancesPlugin): and 'region' in self.stats: msg = 'Cloud ' ret.append(self.curse_add_line(msg, "TITLE")) - msg = '{} instance {} ({})'.format(to_ascii(self.stats['instance-type']), - to_ascii(self.stats['instance-id']), - to_ascii(self.stats['region'])) + msg = '{} instance {} ({})'.format(self.stats['instance-type'], + self.stats['instance-id'], + self.stats['region']) ret.append(self.curse_add_line(msg)) # Return the message with decoration @@ -167,7 +168,7 @@ class ThreadOpenStack(threading.Thread): break else: if r.ok: - self._stats[k] = r.content + self._stats[k] = to_ascii(r.content) return True