Skip to content

Commit

Permalink
sort hba cards by controller is rather than bus address
Browse files Browse the repository at this point in the history
  • Loading branch information
bkelly16 committed Aug 22, 2024
1 parent d7b07ac commit 8e327a4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tools/server_identifier
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,9 @@ def hba_lspci(server):
hba.append(hba_dict.copy())

hba_card_order = getCardOrder()
formatted_hba_order = formatBusAddresses(hba_card_order)
fixControllerID(hba, formatted_hba_order)
if hba_card_order:
formatted_hba_order = formatBusAddresses(hba_card_order)
fixControllerID(hba, formatted_hba_order)

if len(hba) > 0:
for card in hba:
Expand Down Expand Up @@ -589,7 +590,7 @@ def hba_lspci(server):
verify_bus_addresses(sys_bus_addrs,hba)

#sort them in ascending order
hba = sorted(hba, key=lambda k: k['Bus Address'])
hba = sorted(hba, key=lambda k: k['Ctl'])

return hba, hybrid_flag, hwraid_flag

Expand Down

0 comments on commit 8e327a4

Please sign in to comment.