]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume util.encryption ensure int is used for urandom (py3 compat)
authorAlfredo Deza <adeza@redhat.com>
Fri, 18 Jan 2019 17:50:38 +0000 (12:50 -0500)
committerAlfredo Deza <adeza@redhat.com>
Fri, 18 Jan 2019 17:50:38 +0000 (12:50 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/util/encryption.py

index 6632e2b60158116f282819996df03040ae0f93ed..4beac7c640fc02a9c17efa6f1776202b3763777b 100644 (file)
@@ -23,7 +23,7 @@ def create_dmcrypt_key():
     )
     # The size of the key is defined in bits, so we must transform that
     # value to bytes (dividing by 8) because we read in bytes, not bits
-    random_string = os.urandom(dmcrypt_key_size / 8)
+    random_string = os.urandom(int(dmcrypt_key_size / 8))
     key = base64.b64encode(random_string).decode('utf-8')
     return key