diff --git a/glances/exports/glances_mongodb.py b/glances/exports/glances_mongodb.py index eabae605..427a4c97 100644 --- a/glances/exports/glances_mongodb.py +++ b/glances/exports/glances_mongodb.py @@ -12,7 +12,7 @@ import sys from glances.logger import logger -from glances.exports.glances_export import GlancesExport +from glances.exports.export import GlancesExport import pymongo from urllib.parse import quote_plus diff --git a/glances/globals.py b/glances/globals.py index 6bdf140c..4b3e15b0 100644 --- a/glances/globals.py +++ b/glances/globals.py @@ -24,13 +24,14 @@ import types import subprocess from datetime import datetime import re +import base64 import queue from configparser import ConfigParser, NoOptionError, NoSectionError from statistics import mean from xmlrpc.client import Fault, ProtocolError, ServerProxy, Transport, Server from xmlrpc.server import SimpleXMLRPCRequestHandler, SimpleXMLRPCServer -from urllib.request import urlopen, Request, base64 +from urllib.request import urlopen, Request from urllib.error import HTTPError, URLError from urllib.parse import urlparse diff --git a/glances/password.py b/glances/password.py index 181cfb4d..782e6102 100644 --- a/glances/password.py +++ b/glances/password.py @@ -44,7 +44,7 @@ class GlancesPassword(object): def get_hash(self, plain_password, salt=''): """Return the hashed password, salt + pbkdf2_hmac.""" - return to_hex(hashlib.pbkdf2_hmac('sha256', plain_password.encode(), salt.encode(), 100000, dklen=128)) + return hashlib.pbkdf2_hmac('sha256', plain_password.encode(), salt.encode(), 100000, dklen=128).hex() def hash_password(self, plain_password): """Hash password with a salt based on UUID (universally unique identifier)."""