From 0f578d7c7dbdc8b4693bb58c5b7e392d34d2872d Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 30 Aug 2024 10:51:41 -0400 Subject: [PATCH] Ensure decimals are captured from size regex --- daemon-common/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon-common/common.py b/daemon-common/common.py index 79f52a12..d1cb0bb5 100644 --- a/daemon-common/common.py +++ b/daemon-common/common.py @@ -1166,7 +1166,7 @@ def get_detect_device_nvme(detect_string): if _ != "detect": return None - size_re = re_search(r"(\d+)([kKMGTP]B)", _size) + size_re = re_search(r"([\d.]+)([kKMGTP]B)", _size) size_val = float(size_re.group(1)) size_unit = size_re.group(2) size_bytes = int(size_val * unit_map[size_unit])