Solve some encoding issue

This commit is contained in:
nicolargo 2018-06-12 22:28:41 +02:00
parent 3cc7174dc9
commit b016d508f0
2 changed files with 6 additions and 4 deletions

View File

@ -21,7 +21,7 @@
import os
from glances.compat import range
from glances.compat import range, nativestr
from glances.logger import logger
# Use the built-in version of scandir/walk if possible, otherwise
@ -84,6 +84,8 @@ class FolderList(object):
value['path'] = self.config.get_value(section, key + 'path')
if value['path'] is None:
continue
else:
value['path'] = nativestr(value['path'])
# Optional conf keys
for i in ['careful', 'warning', 'critical']:

View File

@ -23,7 +23,7 @@ import os
import threading
import time
from glances.compat import iterkeys, itervalues
from glances.compat import iterkeys, itervalues, nativestr
from glances.logger import logger
from glances.timer import getTimeSinceLastUpdate
from glances.plugins.glances_plugin import GlancesPlugin
@ -204,9 +204,9 @@ class Plugin(GlancesPlugin):
# The key is the container name and not the Id
container_stats['key'] = self.get_key()
# Export name (first name in the Names list, without the /)
container_stats['name'] = container.name
container_stats['name'] = nativestr(container.name)
# Export global Names (used by the WebUI)
container_stats['Names'] = [container.name]
container_stats['Names'] = [ nativestr(container.name)]
# Container Id
container_stats['Id'] = container.id
# Container Image