Skip to content

Commit

Permalink
Sort unitNumber as an integer not a string
Browse files Browse the repository at this point in the history
The get_network_adapters method was sorting NICs by their unitNumber as
an integer.  This was causing '10' to be sorted before '7', '8', and
'9'.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1562089
  • Loading branch information
agrare committed Mar 29, 2018
1 parent 56b62a7 commit 282f0c0
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -140,7 +140,7 @@ def get_network_adapters
end

devs = inventory_hash.fetch_path("config", "hardware", "device") || []
devs.select { |d| d.key?('macAddress') }.sort_by { |d| d['unitNumber'] }
devs.select { |d| d.key?('macAddress') }.sort_by { |d| d['unitNumber'].to_i }
end

def get_network_device(vimVm, _vmcs, _vim = nil, vlan = nil)
Expand Down

0 comments on commit 282f0c0

Please sign in to comment.