ohai 8.3.0.rc.0 → 8.3.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: 31c6368a87a221d3913d78e534ec4ab999877239
4
- data.tar.gz: 37cfbd9731bfbde300a92fb74735a883baf3bb59
3
+ metadata.gz: 126cc8aea8018c470f57fecaadab6f176ba76e46
4
+ data.tar.gz: 44bd077bf56631f93bb71cd0fab55ef9bc826549
5
5
  SHA512:
6
- metadata.gz: 092f4f66e9978df246c2903a0e408635bff308d2f73a5deb49198a0252eef4364969b6b470ca79b7b72cfa12c82818b9d3e6f4a7985556467b72b5ece38efe8a
7
- data.tar.gz: bf77b83c2ade4da425469ccba8713aa0ba48e06adc5d5c42f900ea3caa71c8241d07d632269f7cd718e8bdeae014c05db1cd3c7ea4a8100116c335872861b3f0
6
+ metadata.gz: bf217e044c0c551ff5b1a5225403de3ed380f2f24449b7225f7583ab459ac096f65f3bc48a2186b8dade3f18d1281004764e5d80de369a431f2e767b56806c38
7
+ data.tar.gz: 32af8885f0290102396cfcd140d02fc158d7502fc487f556beb87dcd0f589d0c5ed8a6a1599f702ab19fdc37485152d8954ea981b051c8148742e21868013360
@@ -183,23 +183,5 @@ Ohai.plugin(:Kernel) do
183
183
 
184
184
  kernel[:machine] = machine_lookup("#{kernel[:cs_info][:system_type]}")
185
185
 
186
- kext = Mash.new
187
- pnp_drivers = Mash.new
188
-
189
- drivers = wmi.instances_of('Win32_PnPSignedDriver')
190
- drivers.each do |driver|
191
- pnp_drivers[driver['deviceid']] = Mash.new
192
- driver.wmi_ole_object.properties_.each do |p|
193
- pnp_drivers[driver['deviceid']][p.name.wmi_underscore.to_sym] = driver[p.name.downcase]
194
- end
195
- if driver['devicename']
196
- kext[driver['devicename']] = pnp_drivers[driver['deviceid']]
197
- kext[driver['devicename']][:version] = pnp_drivers[driver['deviceid']][:driver_version]
198
- kext[driver['devicename']][:date] = pnp_drivers[driver['deviceid']][:driver_date] ? pnp_drivers[driver['deviceid']][:driver_date].to_s[0..7] : nil
199
- end
200
- end
201
-
202
- kernel[:pnp_drivers] = pnp_drivers
203
- kernel[:modules] = kext
204
186
  end
205
187
  end
@@ -33,6 +33,10 @@ Ohai.plugin(:Network) do
33
33
  encap
34
34
  end
35
35
 
36
+ def ipv6_enabled?
37
+ File.exist? "/proc/net/if_inet6"
38
+ end
39
+
36
40
  def iproute2_binary_available?
37
41
  ["/sbin/ip", "/usr/bin/ip", "/bin/ip"].any? { |path| File.exist?(path) }
38
42
  end
@@ -60,12 +64,14 @@ Ohai.plugin(:Network) do
60
64
  :default_route => "0.0.0.0/0",
61
65
  :default_prefix => :default,
62
66
  :neighbour_attribute => :arp
63
- },{
67
+ }]
68
+
69
+ families << {
64
70
  :name => "inet6",
65
71
  :default_route => "::/0",
66
72
  :default_prefix => :default_inet6,
67
73
  :neighbour_attribute => :neighbour_inet6
68
- }]
74
+ } if ipv6_enabled?
69
75
 
70
76
  so = shell_out("ip addr")
71
77
  cint = nil
@@ -0,0 +1,47 @@
1
+ #
2
+ # Copyright:: Copyright (c) 2015 Chef Software
3
+ # License:: Apache License, Version 2.0
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+ Ohai.plugin(:Drivers) do
19
+ provides "kernel/pnp_drivers", "kernel/modules"
20
+ depends "kernel"
21
+
22
+ collect_data(:windows) do
23
+ require 'wmi-lite/wmi'
24
+
25
+ wmi = WmiLite::Wmi.new
26
+
27
+ kext = Mash.new
28
+ pnp_drivers = Mash.new
29
+
30
+ drivers = wmi.instances_of('Win32_PnPSignedDriver')
31
+ drivers.each do |driver|
32
+ pnp_drivers[driver['deviceid']] = Mash.new
33
+ driver.wmi_ole_object.properties_.each do |p|
34
+ pnp_drivers[driver['deviceid']][p.name.wmi_underscore.to_sym] = driver[p.name.downcase]
35
+ end
36
+ if driver['devicename']
37
+ kext[driver['devicename']] = pnp_drivers[driver['deviceid']]
38
+ kext[driver['devicename']][:version] = pnp_drivers[driver['deviceid']][:driver_version]
39
+ kext[driver['devicename']][:date] = pnp_drivers[driver['deviceid']][:driver_date] ? pnp_drivers[driver['deviceid']][:driver_date].to_s[0..7] : nil
40
+ end
41
+ end
42
+
43
+ kernel[:pnp_drivers] = pnp_drivers
44
+ kernel[:modules] = kext
45
+
46
+ end
47
+ end
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.3.0.rc.0'
21
+ VERSION = '8.3.0'
22
22
  end
@@ -74,11 +74,10 @@ describe Ohai::System, "plugin kernel" do
74
74
  cs_wmi = WmiLite::Wmi::Instance.new(cs)
75
75
 
76
76
  expect_any_instance_of(WmiLite::Wmi).to receive(:first_of).with('Win32_ComputerSystem').and_return(cs_wmi)
77
- expect_any_instance_of(WmiLite::Wmi).to receive(:instances_of).with('Win32_PnPSignedDriver').and_return([])
78
77
 
79
78
  @plugin.run
80
79
  end
81
- it "should set the corrent system information" do
80
+ it "should set the correct system information" do
82
81
  expect(@ohai_system.data[:kernel][:name]).to eq("Microsoft Windows 7 Ultimate")
83
82
  expect(@ohai_system.data[:kernel][:release]).to eq("6.1.7601")
84
83
  expect(@ohai_system.data[:kernel][:version]).to eq("6.1.7601 Service Pack 1 Build 7601")
@@ -314,7 +314,7 @@ fe80::21c:eff:fe12:3456 dev eth0.153 lladdr 00:1c:0e:30:28:00 router REACHABLE
314
314
  end
315
315
 
316
316
  describe "#iproute2_binary_available?" do
317
- ["/sbin/ip", "/usr/bin/ip"].each do |path|
317
+ ["/sbin/ip", "/usr/bin/ip", "/bin/ip"].each do |path|
318
318
  it "accepts #{path}" do
319
319
  allow(File).to receive(:exist?).and_return(false)
320
320
  allow(File).to receive(:exist?).with(path).and_return(true)
@@ -546,6 +546,7 @@ Destination Gateway Genmask Flags Metric Ref Use Iface
546
546
  describe "for newer network features using iproute2 only" do
547
547
  before(:each) do
548
548
  allow(File).to receive(:exist?).with("/sbin/ip").and_return(true) # iproute2 only
549
+ allow(File).to receive(:exist?).with("/proc/net/if_inet6").and_return(true) # ipv6 is enabled
549
550
  plugin.run
550
551
  end
551
552
 
@@ -591,6 +592,17 @@ Destination Gateway Genmask Flags Metric Ref Use Iface
591
592
  expect(plugin['network']['interfaces']['eth3']['state']).to eq('up')
592
593
  end
593
594
 
595
+ describe "when IPv6 is disabled" do
596
+ before :each do
597
+ allow(File).to receive(:exist?).with("/proc/net/if_inet6").and_return(false)
598
+ plugin.run
599
+ end
600
+
601
+ it "doesn't set ip6address" do
602
+ expect(plugin['ip6address']).to be_nil
603
+ end
604
+ end
605
+
594
606
  describe "when dealing with routes" do
595
607
  it "adds routes" do
596
608
  plugin.run
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.3.0.rc.0
4
+ version: 8.3.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-04-23 00:00:00.000000000 Z
11
+ date: 2015-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types
@@ -377,6 +377,7 @@ files:
377
377
  - lib/ohai/plugins/uptime.rb
378
378
  - lib/ohai/plugins/virtualization.rb
379
379
  - lib/ohai/plugins/windows/cpu.rb
380
+ - lib/ohai/plugins/windows/drivers.rb
380
381
  - lib/ohai/plugins/windows/filesystem.rb
381
382
  - lib/ohai/plugins/windows/network.rb
382
383
  - lib/ohai/plugins/windows/platform.rb
@@ -530,13 +531,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
530
531
  version: 2.0.0
531
532
  required_rubygems_version: !ruby/object:Gem::Requirement
532
533
  requirements:
533
- - - ">"
534
+ - - ">="
534
535
  - !ruby/object:Gem::Version
535
- version: 1.3.1
536
+ version: '0'
536
537
  requirements: []
537
538
  rubyforge_project:
538
- rubygems_version: 2.4.5
539
+ rubygems_version: 2.4.4
539
540
  signing_key:
540
541
  specification_version: 4
541
542
  summary: Ohai profiles your system and emits JSON
542
543
  test_files: []
544
+ has_rdoc: