ohai 8.2.0 → 8.3.0.rc.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c4fdcd52a082fc45f9b8290c5f9a0b235ad4ee8f
4
- data.tar.gz: bdf90d6b5e6c9fd85d9ad4c441cf90e5d30fc3af
3
+ metadata.gz: 31c6368a87a221d3913d78e534ec4ab999877239
4
+ data.tar.gz: 37cfbd9731bfbde300a92fb74735a883baf3bb59
5
5
  SHA512:
6
- metadata.gz: cf65d4334c84ae6d7f0fc28348370763d9f7b2f25cc5ca95fb9dfab6bca028c66f3be0884235ce6ea14b2b696494b150ac285af8e84358ebf652c41e8224fb08
7
- data.tar.gz: f1d9cb9f4d98062ef81d1087fb02d6a261762d096ca5cdae6d643e5817019e1148614873d8bdd564e356ec520460116c6990e426619dbbab826b2bb99f0ac43d
6
+ metadata.gz: 092f4f66e9978df246c2903a0e408635bff308d2f73a5deb49198a0252eef4364969b6b470ca79b7b72cfa12c82818b9d3e6f4a7985556467b72b5ece38efe8a
7
+ data.tar.gz: bf77b83c2ade4da425469ccba8713aa0ba48e06adc5d5c42f900ea3caa71c8241d07d632269f7cd718e8bdeae014c05db1cd3c7ea4a8100116c335872861b3f0
@@ -106,6 +106,7 @@ module Ohai
106
106
  next if field.to_s == 'size'
107
107
  next if field.to_s == 'record_id'
108
108
  translated = field.downcase.gsub(/[^a-z0-9]/, '_')
109
+ value = value.strip
109
110
  if in_common.has_key?(translated)
110
111
  in_common[translated] = nil unless in_common[translated] == value
111
112
  else
@@ -115,7 +116,7 @@ module Ohai
115
116
  }
116
117
  in_common.each{ |field, value|
117
118
  next if value == nil
118
- dmi[type][field] = value
119
+ dmi[type][field] = value.strip
119
120
  }
120
121
  }
121
122
  end
@@ -57,6 +57,7 @@ Ohai.plugin(:DMI) do
57
57
  # ... similar lines trimmed
58
58
  so.stdout.lines do |line|
59
59
  next if blank_line.match(line)
60
+ line = line.encode(line.encoding, :universal_newline => true)
60
61
 
61
62
  if dmidecode_version = dmidecode_version_line.match(line)
62
63
  dmi[:dmidecode_version] = dmidecode_version[1]
@@ -34,7 +34,7 @@ Ohai.plugin(:Network) do
34
34
  end
35
35
 
36
36
  def iproute2_binary_available?
37
- ["/sbin/ip", "/usr/bin/ip"].any? { |path| File.exist?(path) }
37
+ ["/sbin/ip", "/usr/bin/ip", "/bin/ip"].any? { |path| File.exist?(path) }
38
38
  end
39
39
 
40
40
  collect_data(:linux) do
data/lib/ohai/version.rb CHANGED
@@ -18,5 +18,5 @@
18
18
 
19
19
  module Ohai
20
20
  OHAI_ROOT = File.expand_path(File.dirname(__FILE__))
21
- VERSION = '8.2.0'
21
+ VERSION = '8.3.0.rc.0'
22
22
  end
data/spec/spec_helper.rb CHANGED
@@ -32,6 +32,10 @@ def get_plugin(plugin, ohai = Ohai::System.new, path = PLUGIN_PATH)
32
32
  loader.load_plugin(File.join(path, "#{plugin}.rb"))
33
33
  end
34
34
 
35
+ def convert_windows_output(stdout)
36
+ stdout.gsub("\n", "\r\n")
37
+ end
38
+
35
39
  def it_should_check_from(plugin, attribute, from, value)
36
40
  it "should set the #{attribute} to the value from '#{from}'" do
37
41
  @plugin.run
@@ -123,6 +123,12 @@ describe Ohai::System, "plugin dmi" do
123
123
  @plugin.run
124
124
  expect(@plugin[:dmi][id][attribute]).to eql(value)
125
125
  end
126
+ it "should have [:dmi][:#{id}][:#{attribute}] set for windows output" do
127
+ @stdout = convert_windows_output(DMI_OUT)
128
+ expect(@plugin).to receive(:shell_out).with("dmidecode").and_return(mock_shell_out(0, @stdout, ""))
129
+ @plugin.run
130
+ expect(@plugin[:dmi][id][attribute]).to eql(value)
131
+ end
126
132
  end
127
133
  end
128
134
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ohai
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.2.0
4
+ version: 8.3.0.rc.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-25 00:00:00.000000000 Z
11
+ date: 2015-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types
@@ -530,12 +530,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
530
530
  version: 2.0.0
531
531
  required_rubygems_version: !ruby/object:Gem::Requirement
532
532
  requirements:
533
- - - ">="
533
+ - - ">"
534
534
  - !ruby/object:Gem::Version
535
- version: '0'
535
+ version: 1.3.1
536
536
  requirements: []
537
537
  rubyforge_project:
538
- rubygems_version: 2.4.4
538
+ rubygems_version: 2.4.5
539
539
  signing_key:
540
540
  specification_version: 4
541
541
  summary: Ohai profiles your system and emits JSON