Cannot get stats in Cloud plugin (404) #1384

This commit is contained in:
nicolargo 2019-01-19 16:18:05 +01:00
parent e2d7f61eac
commit 9508300d54
2 changed files with 8 additions and 5 deletions

2
NEWS
View File

@ -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:

View File

@ -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