mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Fix tests
This commit is contained in:
parent
711c211440
commit
dbc4716b48
1 changed files with 6 additions and 5 deletions
|
@ -103,7 +103,6 @@ class LDAPServer:
|
|||
|
||||
ldap_interface.update("cn=admin", admin_dict)
|
||||
|
||||
|
||||
def _hash_user_password(self, password):
|
||||
"""
|
||||
Copy pasta of what's in yunohost/user.py
|
||||
|
@ -112,8 +111,10 @@ class LDAPServer:
|
|||
import random
|
||||
import crypt
|
||||
|
||||
char_set = string.ascii_uppercase + string.ascii_lowercase + string.digits + "./"
|
||||
salt = ''.join([random.SystemRandom().choice(char_set) for x in range(16)])
|
||||
char_set = (
|
||||
string.ascii_uppercase + string.ascii_lowercase + string.digits + "./"
|
||||
)
|
||||
salt = "".join([random.SystemRandom().choice(char_set) for x in range(16)])
|
||||
|
||||
salt = '$6$' + salt + '$'
|
||||
return '{CRYPT}' + crypt.crypt(str(password), salt)
|
||||
salt = "$6$" + salt + "$"
|
||||
return "{CRYPT}" + crypt.crypt(str(password), salt)
|
||||
|
|
Loading…
Reference in a new issue