Skip to content

Commit

Permalink
Merge pull request #1568 from chef/split
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Smith <[email protected]>
  • Loading branch information
tas50 authored Nov 18, 2020
2 parents ce379c3 + 2767003 commit 5e14164
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions lib/ohai/plugins/cpu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ def parse_bsd_dmesg(&block)
when /cache size\s+:\s(.+)/
cpuinfo[current_cpu]["cache_size"] = $1
when /flags\s+:\s(.+)/
cpuinfo[current_cpu]["flags"] = $1.split(" ")
cpuinfo[current_cpu]["flags"] = $1.split
when /BogoMIPS\s+:\s(.+)/
cpuinfo[current_cpu]["bogomips"] = $1
when /Features\s+:\s(.+)/
cpuinfo[current_cpu]["features"] = $1.split(" ")
cpuinfo[current_cpu]["features"] = $1.split
when /bogomips per cpu:\s(.+)/
cpuinfo["bogomips_per_cpu"] = $1
when /features\s+:\s(.+)/
cpuinfo["features"] = $1.split(" ")
cpuinfo["features"] = $1.split
when /processor\s(\d):\s(.+)/
current_cpu = $1
cpu_number += 1
Expand Down Expand Up @@ -278,7 +278,7 @@ def parse_bsd_dmesg(&block)
when /^machdep.cpu.stepping: (.*)$/
cpu[:stepping] = Regexp.last_match[1].to_i
when /^machdep.cpu.features: (.*)$/
cpu[:flags] = Regexp.last_match[1].downcase.split(" ")
cpu[:flags] = Regexp.last_match[1].downcase.split
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/ohai/plugins/darwin/network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

def parse_media(media_string)
media = {}
line_array = media_string.split(" ")
line_array = media_string.split

0.upto(line_array.length - 1) do |i|
unless line_array[i].eql?("none")
Expand Down
4 changes: 2 additions & 2 deletions lib/ohai/plugins/joyent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ def is_smartos?
collect_product_file.each do |line|
case line
when /^Image/
sm_image = line.split(" ")
sm_image = line.split
joyent[:sm_image_id] = sm_image[1]
joyent[:sm_image_ver] = sm_image[2]
when /^Base Image/
sm_baseimage = line.split(" ")
sm_baseimage = line.split
joyent[:sm_baseimage_id] = sm_baseimage[2]
joyent[:sm_baseimage_ver] = sm_baseimage[3]
end
Expand Down
2 changes: 1 addition & 1 deletion lib/ohai/plugins/linux/network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ def parse_ip_addr_inet6_line(cint, iface, line)
iface[cint][:addresses] ||= Mash.new
tmp_addr = $1
tags = $4 || ""
tags = tags.split(" ")
tags = tags.split

iface[cint][:addresses][tmp_addr] = {
"family" => "inet6",
Expand Down
2 changes: 1 addition & 1 deletion lib/ohai/plugins/packages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def collect_programs_from_registry_key(key_path)
# Output format is
# name version
so.stdout.lines do |pkg|
name, version = pkg.split(" ")
name, version = pkg.split
packages[name] = { "version" => version }
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/ohai/plugins/uptime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def collect_uptime(path)
end

collect_data(:linux) do
uptime, idletime = file_open("/proc/uptime").gets.split(" ")
uptime, idletime = file_open("/proc/uptime").gets.split
uptime_seconds uptime.to_i
uptime seconds_to_human(uptime.to_i)
idletime_seconds idletime.to_i
Expand Down

0 comments on commit 5e14164

Please sign in to comment.