summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Saxby <sax@livinginthepast.org>2013-11-23 13:34:34 -0800
committerBryan McLellan <btm@opscode.com>2013-11-26 10:57:02 -0800
commit5e6e083422661b38f001fac1ed9dffe29fb88ac7 (patch)
tree93210d4db3d13709ade83328738d9730bb3d2144
parent414fce758ecf2b6eb6e6f5698c2d8456f13387c6 (diff)
downloadohai-5e6e083422661b38f001fac1ed9dffe29fb88ac7.tar.gz
OHAI-529 sort interfaces in ip_scopes before assigning privateaddress
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.
-rw-r--r--lib/ohai/plugins/ip_scopes.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ohai/plugins/ip_scopes.rb b/lib/ohai/plugins/ip_scopes.rb
index 45c056f6..e09dedab 100644
--- a/lib/ohai/plugins/ip_scopes.rb
+++ b/lib/ohai/plugins/ip_scopes.rb
@@ -24,7 +24,7 @@ Ohai.plugin(:IpScopes) do
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]