From f4e946c262179d866b213ebe9d5f1afcab4502bd Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 18 Nov 2024 16:52:55 -0500 Subject: [PATCH] Ensure datahuman is a string if it's not --- daemon-common/ceph.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/daemon-common/ceph.py b/daemon-common/ceph.py index cf4c2ca3..36522694 100644 --- a/daemon-common/ceph.py +++ b/daemon-common/ceph.py @@ -121,6 +121,9 @@ def format_bytes_tohuman(databytes): def format_bytes_fromhuman(datahuman): + if not isinstance(datahuman, str): + datahuman = str(datahuman) + if not re.search(r"[A-Za-z]+", datahuman): dataunit = "B" datasize = float(datahuman)