mirror of https://github.com/nicolargo/glances
Since the last update, using Glances with a password fails with a Python error #2159
parent
f5892af699
commit
b7641a18eb
|
@ -773,5 +773,5 @@ Examples of use:
|
|||
"""
|
||||
from glances.password import GlancesPassword
|
||||
|
||||
password = GlancesPassword(username=username)
|
||||
password = GlancesPassword(username=username, config=self.get_config())
|
||||
return password.get_password(description, confirm, clear)
|
||||
|
|
|
@ -38,9 +38,12 @@ class GlancesPassword(object):
|
|||
"""Return the local password path.
|
||||
Related toissue: Password files in same configuration dir in effect #2143
|
||||
"""
|
||||
return self.config.get_value('passwords',
|
||||
'local_password_path',
|
||||
default=user_config_dir())
|
||||
if self.config is None:
|
||||
return user_config_dir
|
||||
else:
|
||||
return self.config.get_value('passwords',
|
||||
'local_password_path',
|
||||
default=user_config_dir())
|
||||
|
||||
def sha256_hash(self, plain_password):
|
||||
"""Return the SHA-256 of the given password."""
|
||||
|
|
Loading…
Reference in New Issue