From 7c9961875217663f678b8ef6f2bc188bb6f10ae2 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 17 Feb 2020 12:32:20 -0500 Subject: [PATCH] Correct handling of bare bytes values --- daemon-common/ceph.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon-common/ceph.py b/daemon-common/ceph.py index f3884b25..a5d1a371 100644 --- a/daemon-common/ceph.py +++ b/daemon-common/ceph.py @@ -97,8 +97,8 @@ def format_bytes_tohuman(databytes): def format_bytes_fromhuman(datahuman): # Trim off human-readable character - dataunit = datahuman[-1] - datasize = int(datahuman[:-1]) + dataunit = str(datahuman)[-1] + datasize = int(str(datahuman)[:-1]) if not re.match('[A-Z]', dataunit): dataunit = 'B' datasize = int(datahuman)