diff options
-rw-r--r-- | lib/ohai/plugins/linux/network.rb | 2 | ||||
-rw-r--r-- | lib/ohai/plugins/rackspace.rb | 2 | ||||
-rw-r--r-- | lib/ohai/plugins/solaris2/network.rb | 16 |
3 files changed, 10 insertions, 10 deletions
diff --git a/lib/ohai/plugins/linux/network.rb b/lib/ohai/plugins/linux/network.rb index dbe8cd18..98c95245 100644 --- a/lib/ohai/plugins/linux/network.rb +++ b/lib/ohai/plugins/linux/network.rb @@ -380,7 +380,7 @@ Ohai.plugin(:Network) do end def interface_address_not_link_level?(iface, address) - iface[:addresses][address][:scope].downcase != "link" + !iface[:addresses][address][:scope].casecmp("link").zero? end def interface_valid_for_route?(iface, address, family) diff --git a/lib/ohai/plugins/rackspace.rb b/lib/ohai/plugins/rackspace.rb index 52612120..c5444e97 100644 --- a/lib/ohai/plugins/rackspace.rb +++ b/lib/ohai/plugins/rackspace.rb @@ -38,7 +38,7 @@ Ohai.plugin(:Rackspace) do def has_rackspace_metadata? so = shell_out("xenstore-read vm-data/provider_data/provider") if so.exitstatus == 0 - so.stdout.strip.downcase == "rackspace" + so.stdout.strip.casecmp("rackspace").zero? end rescue Ohai::Exceptions::Exec false diff --git a/lib/ohai/plugins/solaris2/network.rb b/lib/ohai/plugins/solaris2/network.rb index 858d5183..7a2a47bc 100644 --- a/lib/ohai/plugins/solaris2/network.rb +++ b/lib/ohai/plugins/solaris2/network.rb @@ -170,14 +170,14 @@ Ohai.plugin(:Network) do matches = /interface: (?<name>\S+)\s+index\s+(?<index>\d+)/.match(line) if matches network[:default_interface] = - case - when iface[matches[:name]] - matches[:name] - when int_name = full_interface_name(iface, matches[:name], matches[:index]) - int_name - else - matches[:name] - end + case + when iface[matches[:name]] + matches[:name] + when int_name = full_interface_name(iface, matches[:name], matches[:index]) + int_name + else + matches[:name] + end Ohai::Log.debug("found interface device: #{network[:default_interface]} #{matches[:name]}") end matches = /gateway: (\S+)/.match(line) |