ohai 15.9.1 → 15.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -3
- data/lib/ohai/plugins/darwin/hardware.rb +2 -2
- data/lib/ohai/plugins/darwin/platform.rb +3 -6
- data/lib/ohai/plugins/kernel.rb +8 -7
- data/lib/ohai/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cc502163cd1c79f43b4b934c425a00b2b00c2626cefb82882659fa4756dd82f
|
4
|
+
data.tar.gz: 2eadca5148f5f1c0706157f3b2c7c2cfe6606c304f249815c418aba69ca87c53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3e0b6ae3e18c740ca5e30db4d4db8200c1cae7b742bd5cdda9541c05cc30e8d0570250b86b51dc5397cd8cc383d63d82240ffb5bb069ce9457b536a6c87dfed
|
7
|
+
data.tar.gz: 3925101539b829009b8215eddaccb20d6b88c791ee69224cddd7d4c824bc5939dab97352e97184183d8f1561b3a14108187370e37ac006869cbc8cceae7ce4f2
|
data/Gemfile
CHANGED
@@ -2,9 +2,8 @@ source "https://rubygems.org"
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
# NOTE: do not submit PRs to add pry as a dep, add to your Gemfile.local
|
6
5
|
group :development do
|
7
|
-
gem "chefstyle",
|
6
|
+
gem "chefstyle", "~> 1.0"
|
8
7
|
gem "rake", ">= 10.1.0"
|
9
8
|
gem "rspec-core", "~> 3.0"
|
10
9
|
gem "rspec-expectations", "~> 3.0"
|
@@ -26,6 +25,6 @@ end
|
|
26
25
|
group :debug do
|
27
26
|
gem "pry"
|
28
27
|
gem "pry-byebug"
|
29
|
-
gem "pry-stack_explorer"
|
28
|
+
gem "pry-stack_explorer", "~> 0.4.0" # pin until we drop ruby < 2.6
|
30
29
|
gem "rb-readline"
|
31
30
|
end
|
@@ -41,8 +41,8 @@ Ohai.plugin(:Hardware) do
|
|
41
41
|
hardware.merge!(hw_hash[0]["_items"][0])
|
42
42
|
|
43
43
|
# ProductName: Mac OS X
|
44
|
-
# ProductVersion: 10.
|
45
|
-
# BuildVersion:
|
44
|
+
# ProductVersion: 10.15.6
|
45
|
+
# BuildVersion: 19G46c
|
46
46
|
shell_out("sw_vers").stdout.lines.each do |line|
|
47
47
|
case line
|
48
48
|
when /^ProductName:\s*(.*)$/
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Adam Jacob (<adam@chef.io>)
|
3
|
-
# Copyright:: Copyright (c)
|
3
|
+
# Copyright:: Copyright (c) Chef Software, Inc.
|
4
4
|
# License:: Apache License, Version 2.0
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -23,11 +23,6 @@ Ohai.plugin(:Platform) do
|
|
23
23
|
so = shell_out((Ohai.abs_path( "/usr/bin/sw_vers" )).to_s)
|
24
24
|
so.stdout.lines do |line|
|
25
25
|
case line
|
26
|
-
when /^ProductName:\s+(.+)$/
|
27
|
-
macname = $1
|
28
|
-
macname.downcase!
|
29
|
-
macname.tr!(" ", "_")
|
30
|
-
platform macname
|
31
26
|
when /^ProductVersion:\s+(.+)$/
|
32
27
|
platform_version $1
|
33
28
|
when /^BuildVersion:\s+(.+)$/
|
@@ -35,6 +30,8 @@ Ohai.plugin(:Platform) do
|
|
35
30
|
end
|
36
31
|
end
|
37
32
|
|
33
|
+
# if we're on darwin assume we're on mac_os_x
|
34
|
+
platform "mac_os_x"
|
38
35
|
platform_family "mac_os_x"
|
39
36
|
end
|
40
37
|
end
|
data/lib/ohai/plugins/kernel.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# Author:: Bryan McLellan (<btm@loftninjas.org>)
|
5
5
|
# Author:: Claire McQuin (<claire@chef.io>)
|
6
6
|
# Author:: James Gartrell (<jgartrel@gmail.com>)
|
7
|
-
# Copyright:: Copyright (c)
|
7
|
+
# Copyright:: Copyright (c) Chef Software, Inc.
|
8
8
|
# Copyright:: Copyright (c) 2009 Bryan McLellan
|
9
9
|
# License:: Apache License, Version 2.0
|
10
10
|
#
|
@@ -137,11 +137,12 @@ Ohai.plugin(:Kernel) do
|
|
137
137
|
end
|
138
138
|
end
|
139
139
|
|
140
|
-
# see if a WMI name is
|
141
|
-
# useless data to ohai
|
140
|
+
# see if a WMI name is in the blocked list so we can avoid writing
|
141
|
+
# out useless data to ohai
|
142
|
+
#
|
142
143
|
# @param [String] name the wmi name to check
|
143
|
-
# @return [Boolean] is the wmi name
|
144
|
-
def
|
144
|
+
# @return [Boolean] is the wmi name in the blocked list
|
145
|
+
def blocked_wmi_name?(name)
|
145
146
|
[
|
146
147
|
"creation_class_name", # this is just the wmi name
|
147
148
|
"cs_creation_class_name", # this is just the wmi name
|
@@ -262,7 +263,7 @@ Ohai.plugin(:Kernel) do
|
|
262
263
|
host = wmi.first_of("Win32_OperatingSystem")
|
263
264
|
kernel[:os_info] = Mash.new
|
264
265
|
host.wmi_ole_object.properties_.each do |p|
|
265
|
-
next if
|
266
|
+
next if blocked_wmi_name?(p.name.wmi_underscore)
|
266
267
|
|
267
268
|
kernel[:os_info][p.name.wmi_underscore.to_sym] = host[p.name.downcase]
|
268
269
|
end
|
@@ -277,7 +278,7 @@ Ohai.plugin(:Kernel) do
|
|
277
278
|
kernel[:cs_info] = Mash.new
|
278
279
|
host = wmi.first_of("Win32_ComputerSystem")
|
279
280
|
host.wmi_ole_object.properties_.each do |p|
|
280
|
-
next if
|
281
|
+
next if blocked_wmi_name?(p.name.wmi_underscore)
|
281
282
|
|
282
283
|
kernel[:cs_info][p.name.wmi_underscore.to_sym] = host[p.name.downcase]
|
283
284
|
end
|
data/lib/ohai/version.rb
CHANGED
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: 15.
|
4
|
+
version: 15.12.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: 2020-
|
11
|
+
date: 2020-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: systemu
|