From 0ab9fa62d6d46464b16f08d3a5bb3da50f5030e7 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Fri, 18 Jan 2019 12:50:38 -0500 Subject: [PATCH] ceph-volume util.encryption ensure int is used for urandom (py3 compat) Signed-off-by: Alfredo Deza --- src/ceph-volume/ceph_volume/util/encryption.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ceph-volume/ceph_volume/util/encryption.py b/src/ceph-volume/ceph_volume/util/encryption.py index 6632e2b6015..4beac7c640f 100644 --- a/src/ceph-volume/ceph_volume/util/encryption.py +++ b/src/ceph-volume/ceph_volume/util/encryption.py @@ -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 -- 2.39.5