Skip to content

Commit

Permalink
Merge pull request rockstor#2346 from phillxnet/2344_Reject_null_seri…
Browse files Browse the repository at this point in the history
…al_disk_entries_from_database

Reject null serial disk entries from database rockstor#2344
  • Loading branch information
phillxnet authored Jan 10, 2022
2 parents f10beb9 + c0ec40a commit 6d0ef2a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rockstor/storageadmin/views/disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,10 @@ def _update_disk_state():
# It makes no sense to save fake serial number drives between scans
# as on each scan the serial number is re-generated (fake) anyway.
# Serial numbers beginning with 'fake-serial-' are from scan_disks.
if (do.serial in serial_numbers_seen) or (
re.match("fake-serial-", do.serial) is not None
if (
(do.serial in serial_numbers_seen)
or (do.serial is None)
or (re.match("fake-serial-", do.serial) is not None)
):
logger.info(
"Deleting duplicate or fake (by serial) disk db "
Expand Down

0 comments on commit 6d0ef2a

Please sign in to comment.