Fix incorrect handling of serial number parsing

This commit is contained in:
Hoang Hong Quan
2024-07-29 08:03:15 +07:00
parent 70c730ef28
commit 32da5452b0

View File

@@ -50,9 +50,9 @@ class SMBIOS:
first_serial = result.stdout.decode().splitlines()[0]
return {
"MLB": "A" + "0"*15 + "Z" if " | " in first_serial else first_serial.split(" | ")[-1],
"MLB": "A" + "0"*15 + "Z" if not " | " in first_serial else first_serial.split(" | ")[-1],
"ROM": random_mac_address,
"SystemProductName": product_name,
"SystemSerialNumber": "A" + "0"*10 + "9" if " | " in first_serial else first_serial.split(" | ")[0],
"SystemSerialNumber": "A" + "0"*10 + "9" if not " | " in first_serial else first_serial.split(" | ")[0],
"SystemUUID": str(uuid.uuid4()).upper(),
}