Commit 88cb1b27 authored by Romain Courteaud's avatar Romain Courteaud

slapos.recipe.random: allow to use a character twice in a password

parent 09e3def5
Pipeline #18598 failed with stage
......@@ -107,8 +107,9 @@ class Mac(object):
pass
def generatePassword(length):
return ''.join(random.SystemRandom().sample(
string.ascii_letters + string.digits, length))
system_random = random.SystemRandom()
alphabet = string.ascii_letters + string.digits
return ''.join(system_random.choice(alphabet) for i in range(length))
class Password(object):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment