From b34550543cdfd177d4d4d57f8aa4b5ed89b81d7b Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 30 Aug 2024 11:08:59 -0400 Subject: [PATCH] Fix bug with matching decimals in detect: strings --- templates/detect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/detect.py b/templates/detect.py index 96df479..4cc2568 100755 --- a/templates/detect.py +++ b/templates/detect.py @@ -149,7 +149,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])