Skip to content

Commit

Permalink
Merge pull request #69 from Heidistein/Heidistein-patch-1
Browse files Browse the repository at this point in the history
Allow for empty serial.
  • Loading branch information
ralequi committed May 17, 2023
2 parents 03529ea + 95a26fc commit 9c5d7ad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pySMART/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,11 @@ class members, including the SMART attribute table and self-test log.
continue

if any_in(line, 'Serial Number', 'Serial number'):
self.serial = line.split(':')[1].split()[0].rstrip()
try:
self.serial = line.split(':')[1].split()[0].rstrip()
except IndexError:
# Serial reported empty
self.serial = ""
continue

vendor = re.compile(r'^Vendor:\s+(\w+)').match(line)
Expand Down

0 comments on commit 9c5d7ad

Please sign in to comment.