Merge pull request #768 from philenotfound/master

In case all IDs are reserved recommend 0
This commit is contained in:
Daniel Markstedt 2022-06-30 22:50:14 -07:00 committed by GitHub
commit 94c98b4577
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,10 @@ def get_valid_scsi_ids(devices, reserved_ids):
if unoccupied_ids:
recommended_id = unoccupied_ids[-1]
else:
recommended_id = occupied_ids.pop(0)
if occupied_ids:
recommended_id = occupied_ids.pop(0)
else:
recommended_id = 0
return valid_ids, recommended_id