Fix bug with matching decimals in detect: strings

This commit is contained in:
Joshua Boniface 2024-08-30 11:08:59 -04:00
parent 362c52e3e5
commit b34550543c
1 changed files with 1 additions and 1 deletions

View File

@ -149,7 +149,7 @@ def get_detect_device_nvme(detect_string):
if _ != "detect": if _ != "detect":
return None 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_val = float(size_re.group(1))
size_unit = size_re.group(2) size_unit = size_re.group(2)
size_bytes = int(size_val * unit_map[size_unit]) size_bytes = int(size_val * unit_map[size_unit])