Skip to content

Commit

Permalink
Merge pull request #632 from NebraLtd/shawaj-patch-1
Browse files Browse the repository at this point in the history
fix serial check for rockpi
  • Loading branch information
shawaj authored Jun 29, 2023
2 parents 8ca36df + 1b1aea7 commit 16b483c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hw_diag/utilities/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,12 @@ def get_serial_number(diagnostics):
cpuinfo = load_cpu_info()
serial = load_serial_number()
serial_number = ""
if has_valid_serial(serial):
if has_valid_serial(serial) and not is_rockpi():
serial_number = serial[CPUINFO_SERIAL_KEY]
elif has_valid_serial(cpuinfo):
serial_number = cpuinfo[CPUINFO_SERIAL_KEY]
elif has_valid_serial(serial) and is_rockpi():
serial_number = serial[CPUINFO_SERIAL_KEY]
else:
serial_number = "Serial number not found"
except FileNotFoundError as e:
Expand Down

0 comments on commit 16b483c

Please sign in to comment.