diff options
Diffstat (limited to 'lib/ohai')
-rw-r--r-- | lib/ohai/mixin/command.rb | 4 | ||||
-rw-r--r-- | lib/ohai/plugins/aix/virtualization.rb | 6 | ||||
-rw-r--r-- | lib/ohai/plugins/darwin/network.rb | 2 | ||||
-rw-r--r-- | lib/ohai/plugins/linux/cpu.rb | 2 | ||||
-rw-r--r-- | lib/ohai/plugins/linux/virtualization.rb | 2 | ||||
-rw-r--r-- | lib/ohai/plugins/network.rb | 6 | ||||
-rw-r--r-- | lib/ohai/plugins/network_listeners.rb | 4 | ||||
-rw-r--r-- | lib/ohai/plugins/sigar/network.rb | 2 | ||||
-rw-r--r-- | lib/ohai/plugins/sigar/network_route.rb | 2 | ||||
-rw-r--r-- | lib/ohai/plugins/solaris2/cpu.rb | 2 | ||||
-rw-r--r-- | lib/ohai/plugins/solaris2/dmi.rb | 2 | ||||
-rw-r--r-- | lib/ohai/plugins/solaris2/zpools.rb | 2 | ||||
-rw-r--r-- | lib/ohai/plugins/windows/network.rb | 2 | ||||
-rw-r--r-- | lib/ohai/system.rb | 2 |
14 files changed, 20 insertions, 20 deletions
diff --git a/lib/ohai/mixin/command.rb b/lib/ohai/mixin/command.rb index 69c1c095..b76fa3ef 100644 --- a/lib/ohai/mixin/command.rb +++ b/lib/ohai/mixin/command.rb @@ -37,7 +37,7 @@ module Ohai module_function :shell_out def run_command(args = {}) - Ohai::Log.warn("Ohai::Mixin::Command run_command is deprecated and will be removed in Ohai 9.0.0") + Ohai::Log.warn('Ohai::Mixin::Command run_command is deprecated and will be removed in Ohai 9.0.0') if args.has_key?(:creates) if File.exists?(args[:creates]) Ohai::Log.debug("Skipping #{args[:command]} - creates #{args[:creates]} exists.") @@ -125,7 +125,7 @@ module Ohai # # Thanks Ara! def popen4(cmd, args = {}, &b) - Ohai::Log.warn("Ohai::Mixin::Command popen4 is deprecated and will be removed in Ohai 9.0.0") + Ohai::Log.warn('Ohai::Mixin::Command popen4 is deprecated and will be removed in Ohai 9.0.0') # Disable garbage collection to work around possible bug in MRI # Ruby 1.8 suffers from intermittent segfaults believed to be due to GC while IO.select diff --git a/lib/ohai/plugins/aix/virtualization.rb b/lib/ohai/plugins/aix/virtualization.rb index 9271323a..fdce73ef 100644 --- a/lib/ohai/plugins/aix/virtualization.rb +++ b/lib/ohai/plugins/aix/virtualization.rb @@ -82,8 +82,8 @@ Ohai.plugin(:Virtualization) do value = { "mountpoint" => splat[0], "device" => splat[1], - "vfs" => splat[2], - "options" => splat[3].split(","), + "vfs" => splat[2], + "options" => splat[3].split(","), } wpars[wpar_name][title][key] = value when "security settings" @@ -103,7 +103,7 @@ Ohai.plugin(:Virtualization) do key = splat[0].downcase value = { "type" => splat[1], - "status" => splat[2], + "status" => splat[2], } wpars[wpar_name][title][key] = value else diff --git a/lib/ohai/plugins/darwin/network.rb b/lib/ohai/plugins/darwin/network.rb index 164ecbb6..52febfce 100644 --- a/lib/ohai/plugins/darwin/network.rb +++ b/lib/ohai/plugins/darwin/network.rb @@ -185,7 +185,7 @@ Ohai.plugin(:Network) do so = shell_out("netstat -i -d -l -b -n") so.stdout.lines do |line| if line =~ /^([a-zA-Z0-9\.\:\-\*]+)\s+\d+\s+\<[a-zA-Z0-9\#]+\>\s+([a-f0-9\:]+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)/ || - line =~ /^([a-zA-Z0-9\.\:\-\*]+)\s+\d+\s+\<[a-zA-Z0-9\#]+\>(\s+)(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)/ + line =~ /^([a-zA-Z0-9\.\:\-\*]+)\s+\d+\s+\<[a-zA-Z0-9\#]+\>(\s+)(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)/ ifname = locate_interface(iface, $1, $2) next if iface[ifname].nil? # this shouldn't happen, but just in case net_counters[ifname] = Mash.new unless net_counters[ifname] diff --git a/lib/ohai/plugins/linux/cpu.rb b/lib/ohai/plugins/linux/cpu.rb index 287e8def..9b9e0b72 100644 --- a/lib/ohai/plugins/linux/cpu.rb +++ b/lib/ohai/plugins/linux/cpu.rb @@ -68,7 +68,7 @@ Ohai.plugin(:CPU) do cpu_number += 1 cpuinfo[current_cpu] = Mash.new current_cpu_info = $2.split(",") - current_cpu_info.each do |i| + for i in current_cpu_info name_value = i.split("=") name = name_value[0].strip value = name_value[1].strip diff --git a/lib/ohai/plugins/linux/virtualization.rb b/lib/ohai/plugins/linux/virtualization.rb index ae559b58..d681bc5d 100644 --- a/lib/ohai/plugins/linux/virtualization.rb +++ b/lib/ohai/plugins/linux/virtualization.rb @@ -163,7 +163,7 @@ Ohai.plugin(:Virtualization) do if File.exist?("/proc/self/cgroup") cgroup_content = File.read("/proc/self/cgroup") if cgroup_content =~ %r{^\d+:[^:]+:/(lxc|docker)/.+$} || - cgroup_content =~ %r{^\d+:[^:]+:/[^/]+/(lxc|docker)-.+$} + cgroup_content =~ %r{^\d+:[^:]+:/[^/]+/(lxc|docker)-.+$} virtualization[:system] = $1 virtualization[:role] = "guest" virtualization[:systems][$1.to_sym] = "guest" diff --git a/lib/ohai/plugins/network.rb b/lib/ohai/plugins/network.rb index e33b2d9d..caa3e840 100644 --- a/lib/ohai/plugins/network.rb +++ b/lib/ohai/plugins/network.rb @@ -79,8 +79,8 @@ Ohai.plugin(:NetworkAddresses) do if gw_if_ips.empty? Ohai::Log.warn("[#{family}] no ip address on #{network[int_attr]}") elsif network[gw_attr] && - network["interfaces"][network[int_attr]] && - network["interfaces"][network[int_attr]]["addresses"] + network["interfaces"][network[int_attr]] && + network["interfaces"][network[int_attr]]["addresses"] if [ "0.0.0.0", "::", /^fe80:/ ].any? { |pat| pat === network[gw_attr] } # link level default route Ohai::Log.debug("link level default #{family} route, picking ip from #{network[gw_attr]}") @@ -176,7 +176,7 @@ Ohai.plugin(:NetworkAddresses) do end if results["inet"]["iface"] && results["inet6"]["iface"] && - (results["inet"]["iface"] != results["inet6"]["iface"]) + (results["inet"]["iface"] != results["inet6"]["iface"]) Ohai::Log.debug("ipaddress and ip6address are set from different interfaces (#{results["inet"]["iface"]} & #{results["inet6"]["iface"]})") end end diff --git a/lib/ohai/plugins/network_listeners.rb b/lib/ohai/plugins/network_listeners.rb index 292378d7..62661c77 100644 --- a/lib/ohai/plugins/network_listeners.rb +++ b/lib/ohai/plugins/network_listeners.rb @@ -23,7 +23,7 @@ Ohai.plugin(:NetworkListeners) do collect_data do begin - require "sigar" + require 'sigar' flags = Sigar::NETCONN_TCP | Sigar::NETCONN_SERVER network Mash.new unless network @@ -54,7 +54,7 @@ Ohai.plugin(:NetworkListeners) do network[:listeners] = Mash.new network[:listeners][:tcp] = listeners rescue LoadError - Ohai::Log.debug("Could not load sigar gem. Skipping NetworkListeners plugin") + Ohai::Log.debug('Could not load sigar gem. Skipping NetworkListeners plugin') end end end diff --git a/lib/ohai/plugins/sigar/network.rb b/lib/ohai/plugins/sigar/network.rb index b5645060..d5bfa52d 100644 --- a/lib/ohai/plugins/sigar/network.rb +++ b/lib/ohai/plugins/sigar/network.rb @@ -58,7 +58,7 @@ Ohai.plugin(:Network) do iface[cint][:addresses][ifconfig.address] = { "family" => "inet" } # Backwards compat: no broadcast on tunnel or loopback dev if ((ifconfig.flags & Sigar::IFF_POINTOPOINT) == 0) && - ((ifconfig.flags & Sigar::IFF_LOOPBACK) == 0) + ((ifconfig.flags & Sigar::IFF_LOOPBACK) == 0) iface[cint][:addresses][ifconfig.address]["broadcast"] = ifconfig.broadcast end iface[cint][:addresses][ifconfig.address]["netmask"] = ifconfig.netmask diff --git a/lib/ohai/plugins/sigar/network_route.rb b/lib/ohai/plugins/sigar/network_route.rb index 4d191e9f..f4d3161f 100644 --- a/lib/ohai/plugins/sigar/network_route.rb +++ b/lib/ohai/plugins/sigar/network_route.rb @@ -59,6 +59,6 @@ Ohai.plugin(:NetworkRoutes) do end end rescue LoadError - Ohai::Log.debug("Could not load sigar gem. Skipping NetworkRoutes plugin") + Ohai::Log.debug('Could not load sigar gem. Skipping NetworkRoutes plugin') end end diff --git a/lib/ohai/plugins/solaris2/cpu.rb b/lib/ohai/plugins/solaris2/cpu.rb index 52b8941e..4a60318e 100644 --- a/lib/ohai/plugins/solaris2/cpu.rb +++ b/lib/ohai/plugins/solaris2/cpu.rb @@ -33,7 +33,7 @@ Ohai.plugin(:CPU) do processor_info.each_with_index do |processor, i| desc, instance, record, keyvalue = processor.split(":") cpu[instance] ||= Mash.new - if currentcpu != instance + if (currentcpu != instance) cpu["total"] += 1 currentcpu = instance end diff --git a/lib/ohai/plugins/solaris2/dmi.rb b/lib/ohai/plugins/solaris2/dmi.rb index 96e57b15..f4d8cc3c 100644 --- a/lib/ohai/plugins/solaris2/dmi.rb +++ b/lib/ohai/plugins/solaris2/dmi.rb @@ -117,7 +117,7 @@ Ohai.plugin(:DMI) do # remove/replace any characters that don't fall inside permissible ASCII range, or whitespace line = raw_line.gsub(/[^\x20-\x7E\n\t\r]/, ".") - if line != raw_line + if (line != raw_line) Ohai::Log.debug("converted characters from line:\n#{raw_line}") end diff --git a/lib/ohai/plugins/solaris2/zpools.rb b/lib/ohai/plugins/solaris2/zpools.rb index 9356c29c..94f0a3ac 100644 --- a/lib/ohai/plugins/solaris2/zpools.rb +++ b/lib/ohai/plugins/solaris2/zpools.rb @@ -39,7 +39,7 @@ Ohai.plugin(:Zpools) do end # Grab individual health for devices in the zpools - pools.keys.each do |pool| + for pool in pools.keys pools[pool][:devices] = Mash.new # Run "zpool status" as non-root user (adm) so that # the command won't try to open() each device which can diff --git a/lib/ohai/plugins/windows/network.rb b/lib/ohai/plugins/windows/network.rb index 37f92fdc..65d76cd1 100644 --- a/lib/ohai/plugins/windows/network.rb +++ b/lib/ohai/plugins/windows/network.rb @@ -96,7 +96,7 @@ Ohai.plugin(:Network) do # Apparently you can have more than one mac_address? Odd. [iface[cint][:configuration][:mac_address]].flatten.each do |mac_addr| iface[cint][:addresses][mac_addr] = { - "family" => "lladdr" + "family" => "lladdr" } end iface[cint][:mtu] = iface[cint][:configuration][:mtu] diff --git a/lib/ohai/system.rb b/lib/ohai/system.rb index 4a09966c..c36ac7f6 100644 --- a/lib/ohai/system.rb +++ b/lib/ohai/system.rb @@ -212,7 +212,7 @@ module Ohai Ohai.config.merge!(@config) if Ohai.config[:directory] && - !Ohai.config[:plugin_path].include?(Ohai.config[:directory]) + !Ohai.config[:plugin_path].include?(Ohai.config[:directory]) Ohai.config[:plugin_path] << Ohai.config[:directory] end end |