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 +4 -4
- data/lib/ohai/common/dmi.rb +2 -1
- data/lib/ohai/plugins/dmi.rb +1 -0
- data/lib/ohai/plugins/linux/network.rb +1 -1
- data/lib/ohai/version.rb +1 -1
- data/spec/spec_helper.rb +4 -0
- data/spec/unit/plugins/dmi_spec.rb +6 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31c6368a87a221d3913d78e534ec4ab999877239
|
4
|
+
data.tar.gz: 37cfbd9731bfbde300a92fb74735a883baf3bb59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 092f4f66e9978df246c2903a0e408635bff308d2f73a5deb49198a0252eef4364969b6b470ca79b7b72cfa12c82818b9d3e6f4a7985556467b72b5ece38efe8a
|
7
|
+
data.tar.gz: bf77b83c2ade4da425469ccba8713aa0ba48e06adc5d5c42f900ea3caa71c8241d07d632269f7cd718e8bdeae014c05db1cd3c7ea4a8100116c335872861b3f0
|
data/lib/ohai/common/dmi.rb
CHANGED
@@ -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
|
data/lib/ohai/plugins/dmi.rb
CHANGED
@@ -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]
|
data/lib/ohai/version.rb
CHANGED
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.
|
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-
|
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:
|
535
|
+
version: 1.3.1
|
536
536
|
requirements: []
|
537
537
|
rubyforge_project:
|
538
|
-
rubygems_version: 2.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
|