mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
fix py3 error in rand_str
This commit is contained in:
parent
4f9ceda7f5
commit
c29c52a817
@ -503,7 +503,7 @@ def rand_str(size=9999999999, hash_type=None):
|
||||
if not hash_type:
|
||||
hash_type = 'md5'
|
||||
hasher = getattr(hashlib, hash_type)
|
||||
return hasher(str(random.SystemRandom().randint(0, size))).hexdigest()
|
||||
return hasher(to_bytes(str(random.SystemRandom().randint(0, size)))).hexdigest()
|
||||
|
||||
|
||||
def which(exe=None):
|
||||
|
Loading…
Reference in New Issue
Block a user