Merge "Convert bytes to string in get_id for python3 compatibility"

This commit is contained in:
Jenkins 2016-03-01 06:52:48 +00:00 committed by Gerrit Code Review
commit c19e52f15f
1 changed files with 4 additions and 1 deletions

View File

@ -51,7 +51,10 @@ def get_id(source_uuid):
# The first 12 bytes (= 60 bits) of base32-encoded output is our data
encoded = base64.b32encode(six.b(random_bytes))[:12]
return encoded.lower()
if six.PY3:
return encoded.lower().decode('utf-8')
else:
return encoded.lower()
def generate_id():