Fix bug with matching decimals in detect: strings
This commit is contained in:
parent
362c52e3e5
commit
b34550543c
|
@ -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])
|
||||||
|
|
Loading…
Reference in New Issue