print macs

This commit is contained in:
Cayo Puigdefabregas 2024-09-20 18:22:27 +02:00
parent d144cef7b8
commit b36636d28e
1 changed files with 4 additions and 0 deletions

View File

@ -29,6 +29,7 @@ def get_mac(hwinfo):
if "HW Address:" in n:
if low_ix <= ix:
mac = c.split(" ")[-1]
print(f"MAC: {mac}")
return mac
@ -105,5 +106,8 @@ class Build:
sku = self.get_sku()
hwinfo_raw = snapshot["data"]["hwinfo"]
mac = get_mac(hwinfo_raw) or ""
if not mac:
print("WARNING!! No there are MAC address")
print(f"{manufacturer}{model}{chassis}{serial_number}{sku}{mac}")
return f"{manufacturer}{model}{chassis}{serial_number}{sku}{mac}"