Skip to content

Commit

Permalink
OHAI-529 sort interfaces in ip_scopes before assigning privateaddress
Browse files Browse the repository at this point in the history
Hash keys are ordered in Ruby > 1.9, so the plugin behaved differently
between 1.8 and newer versions. In order to make the code (and tests)
more deterministic, let's sort network interfaces before doing work.
  • Loading branch information
sax authored and btm committed Nov 26, 2013
1 parent 414fce7 commit 5e6e083
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ohai/plugins/ip_scopes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
begin
require 'ipaddr_extensions'

network['interfaces'].keys.each do |ifName|
network['interfaces'].keys.sort.each do |ifName|
next if network['interfaces'][ifName]['addresses'].nil?

interface = network['interfaces'][ifName]
Expand Down

0 comments on commit 5e6e083

Please sign in to comment.