ohai 16.2.0 → 16.4.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -1
- data/bin/ohai +0 -2
- data/lib/ohai/application.rb +2 -2
- data/lib/ohai/dsl/plugin.rb +1 -1
- data/lib/ohai/loader.rb +1 -2
- data/lib/ohai/log.rb +1 -1
- data/lib/ohai/mixin/command.rb +1 -1
- data/lib/ohai/mixin/dmi_decode.rb +2 -2
- data/lib/ohai/mixin/os.rb +1 -1
- data/lib/ohai/mixin/softlayer_metadata.rb +1 -1
- data/lib/ohai/plugins/aix/memory.rb +3 -3
- data/lib/ohai/plugins/aix/network.rb +2 -1
- data/lib/ohai/plugins/aix/uptime.rb +2 -2
- data/lib/ohai/plugins/aix/virtualization.rb +5 -5
- data/lib/ohai/plugins/azure.rb +1 -1
- data/lib/ohai/plugins/bsd/virtualization.rb +2 -2
- data/lib/ohai/plugins/c.rb +2 -2
- data/lib/ohai/plugins/cloud.rb +1 -1
- data/lib/ohai/plugins/cpu.rb +2 -2
- data/lib/ohai/plugins/darwin/hardware.rb +2 -2
- data/lib/ohai/plugins/darwin/network.rb +3 -3
- data/lib/ohai/plugins/darwin/platform.rb +3 -6
- data/lib/ohai/plugins/darwin/virtualization.rb +1 -1
- data/lib/ohai/plugins/docker.rb +2 -2
- data/lib/ohai/plugins/dragonflybsd/platform.rb +2 -4
- data/lib/ohai/plugins/ec2.rb +8 -7
- data/lib/ohai/plugins/eucalyptus.rb +1 -1
- data/lib/ohai/plugins/filesystem.rb +11 -17
- data/lib/ohai/plugins/fips.rb +1 -5
- data/lib/ohai/plugins/freebsd/platform.rb +2 -4
- data/lib/ohai/plugins/gce.rb +3 -3
- data/lib/ohai/plugins/hostname.rb +16 -16
- data/lib/ohai/plugins/kernel.rb +1 -1
- data/lib/ohai/plugins/linux/hostnamectl.rb +1 -2
- data/lib/ohai/plugins/linux/interrupts.rb +1 -1
- data/lib/ohai/plugins/linux/lsb.rb +1 -2
- data/lib/ohai/plugins/linux/lspci.rb +1 -2
- data/lib/ohai/plugins/linux/machineid.rb +2 -2
- data/lib/ohai/plugins/linux/mdadm.rb +1 -1
- data/lib/ohai/plugins/linux/network.rb +19 -9
- data/lib/ohai/plugins/linux/platform.rb +22 -25
- data/lib/ohai/plugins/linux/virtualization.rb +12 -9
- data/lib/ohai/plugins/netbsd/network.rb +4 -8
- data/lib/ohai/plugins/netbsd/platform.rb +2 -4
- data/lib/ohai/plugins/network.rb +5 -4
- data/lib/ohai/plugins/openbsd/network.rb +4 -8
- data/lib/ohai/plugins/openbsd/platform.rb +2 -4
- data/lib/ohai/plugins/openstack.rb +3 -2
- data/lib/ohai/plugins/packages.rb +1 -1
- data/lib/ohai/plugins/passwd.rb +2 -1
- data/lib/ohai/plugins/rackspace.rb +5 -4
- data/lib/ohai/plugins/root_group.rb +1 -1
- data/lib/ohai/plugins/ruby.rb +4 -15
- data/lib/ohai/plugins/scaleway.rb +1 -1
- data/lib/ohai/plugins/shard.rb +1 -1
- data/lib/ohai/plugins/solaris2/dmi.rb +2 -3
- data/lib/ohai/plugins/solaris2/memory.rb +1 -2
- data/lib/ohai/plugins/solaris2/network.rb +2 -6
- data/lib/ohai/plugins/solaris2/platform.rb +1 -2
- data/lib/ohai/plugins/solaris2/virtualization.rb +3 -6
- data/lib/ohai/plugins/ssh_host_key.rb +1 -1
- data/lib/ohai/plugins/uptime.rb +1 -1
- data/lib/ohai/plugins/vmware.rb +2 -2
- data/lib/ohai/plugins/windows/dmi.rb +2 -2
- data/lib/ohai/plugins/windows/drivers.rb +1 -1
- data/lib/ohai/plugins/windows/memory.rb +1 -1
- data/lib/ohai/plugins/windows/network.rb +3 -3
- data/lib/ohai/plugins/windows/platform.rb +1 -1
- data/lib/ohai/plugins/windows/virtualization.rb +1 -1
- data/lib/ohai/provides_map.rb +2 -2
- data/lib/ohai/runner.rb +1 -1
- data/lib/ohai/util/ip_helper.rb +2 -2
- data/lib/ohai/util/win32.rb +1 -1
- data/lib/ohai/version.rb +1 -1
- data/ohai.gemspec +0 -1
- metadata +2 -16
@@ -25,9 +25,7 @@ Ohai.plugin(:Virtualization) do
|
|
25
25
|
depends "dmi"
|
26
26
|
|
27
27
|
def collect_solaris_guestid
|
28
|
-
|
29
|
-
so = shell_out(command)
|
30
|
-
so.stdout.split(":").first
|
28
|
+
shell_out("/usr/sbin/zoneadm list -p").stdout.split(":").first
|
31
29
|
end
|
32
30
|
|
33
31
|
collect_data(:solaris2) do
|
@@ -38,7 +36,7 @@ Ohai.plugin(:Virtualization) do
|
|
38
36
|
psrinfo_path = Ohai.abs_path( "/usr/sbin/psrinfo" )
|
39
37
|
if File.exist?(psrinfo_path)
|
40
38
|
so = shell_out("#{psrinfo_path} -pv")
|
41
|
-
if
|
39
|
+
if /QEMU Virtual CPU|Common KVM processor|Common 32-bit KVM processor/.match?(so.stdout)
|
42
40
|
virtualization[:system] = "kvm"
|
43
41
|
virtualization[:role] = "guest"
|
44
42
|
virtualization[:systems][:kvm] = "guest"
|
@@ -56,8 +54,7 @@ Ohai.plugin(:Virtualization) do
|
|
56
54
|
|
57
55
|
if File.executable?("/usr/sbin/zoneadm")
|
58
56
|
zones = Mash.new
|
59
|
-
|
60
|
-
so.stdout.lines do |line|
|
57
|
+
shell_out("zoneadm list -pc").stdout.lines do |line|
|
61
58
|
info = line.chomp.split(/:/)
|
62
59
|
zones[info[1]] = {
|
63
60
|
"id" => info[0],
|
@@ -51,7 +51,7 @@ Ohai.plugin(:SSHHostKey) do
|
|
51
51
|
if sshd_config
|
52
52
|
File.open(sshd_config) do |conf|
|
53
53
|
conf.each_line do |line|
|
54
|
-
if
|
54
|
+
if /^hostkey\s/i.match?(line)
|
55
55
|
pub_file = "#{line.split[1]}.pub"
|
56
56
|
content = IO.read(pub_file).split
|
57
57
|
key_type, key_subtype = extract_keytype?(content)
|
data/lib/ohai/plugins/uptime.rb
CHANGED
@@ -84,7 +84,7 @@ Ohai.plugin(:Uptime) do
|
|
84
84
|
end
|
85
85
|
|
86
86
|
collect_data(:windows) do
|
87
|
-
require "wmi-lite/wmi"
|
87
|
+
require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
|
88
88
|
wmi = WmiLite::Wmi.new
|
89
89
|
last_boot_up_time = wmi.first_of("Win32_OperatingSystem")["lastbootuptime"]
|
90
90
|
uptime_seconds Time.new.to_i - Time.parse(last_boot_up_time).to_i
|
data/lib/ohai/plugins/vmware.rb
CHANGED
@@ -51,12 +51,12 @@ Ohai.plugin(:VMware) do
|
|
51
51
|
# to attribute "vmware[:<parameter>]"
|
52
52
|
%w{hosttime speed sessionid balloon swap memlimit memres cpures cpulimit}.each do |param|
|
53
53
|
vmware[param] = from_cmd("#{vmtools_path} stat #{param}")
|
54
|
-
if vmware[param]
|
54
|
+
if /UpdateInfo failed/.match?(vmware[param])
|
55
55
|
vmware[param] = nil
|
56
56
|
end
|
57
57
|
end
|
58
58
|
# vmware-toolbox-cmd <param> status commands
|
59
|
-
# Iterate through each parameter supported by the "
|
59
|
+
# Iterate through each parameter supported by the "vmware-toolbox-cmd status" command, assign value
|
60
60
|
# to attribute "vmware[:<parameter>]"
|
61
61
|
%w{upgrade timesync}.each do |param|
|
62
62
|
vmware[param] = from_cmd("#{vmtools_path} #{param} status")
|
@@ -45,8 +45,8 @@ Ohai.plugin(:DMI) do
|
|
45
45
|
].freeze
|
46
46
|
|
47
47
|
collect_data(:windows) do
|
48
|
-
|
49
|
-
require "wmi-lite/wmi"
|
48
|
+
require_relative "../../common/dmi"
|
49
|
+
require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
|
50
50
|
wmi = WmiLite::Wmi.new
|
51
51
|
|
52
52
|
dmi Mash.new
|
@@ -93,7 +93,7 @@ Ohai.plugin(:Network) do
|
|
93
93
|
|
94
94
|
# Selects default interface and returns its information
|
95
95
|
#
|
96
|
-
# @note Interface with least metric value should be
|
96
|
+
# @note Interface with least metric value should be preferred as default_route
|
97
97
|
#
|
98
98
|
# @param configuration [Mash] Configuration of interfaces as iface_config
|
99
99
|
# [<interface_index> => {<interface_configurations>}]
|
@@ -118,7 +118,7 @@ Ohai.plugin(:Network) do
|
|
118
118
|
|
119
119
|
collect_data(:windows) do
|
120
120
|
|
121
|
-
require "wmi-lite/wmi"
|
121
|
+
require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
|
122
122
|
|
123
123
|
iface = Mash.new
|
124
124
|
iface_config = Mash.new
|
@@ -171,7 +171,7 @@ Ohai.plugin(:Network) do
|
|
171
171
|
iface[cint][:addresses][ip] = Mash.new(prefixlen: ip2.prefix)
|
172
172
|
if ip2.ipv6?
|
173
173
|
iface[cint][:addresses][ip][:family] = "inet6"
|
174
|
-
iface[cint][:addresses][ip][:scope] = "Link" if
|
174
|
+
iface[cint][:addresses][ip][:scope] = "Link" if /^fe80/i.match?(ip)
|
175
175
|
else
|
176
176
|
if iface[cint][:configuration][:ip_subnet]
|
177
177
|
iface[cint][:addresses][ip][:netmask] = ip2.netmask.to_s
|
@@ -16,7 +16,7 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
# After long discussion in IRC the "powers that be" have come to a
|
19
|
+
# After long discussion in IRC the "powers that be" have come to a consensus
|
20
20
|
# that there is no other Windows platforms exist that were not based on the
|
21
21
|
# Windows_NT kernel, so we herby decree that "windows" will refer to all
|
22
22
|
# platforms built upon the Windows_NT kernel and have access to win32 or win64
|
@@ -24,7 +24,7 @@ Ohai.plugin(:Virtualization) do
|
|
24
24
|
include Ohai::Mixin::DmiDecode
|
25
25
|
|
26
26
|
collect_data(:windows) do
|
27
|
-
require "wmi-lite/wmi"
|
27
|
+
require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
|
28
28
|
|
29
29
|
virtualization Mash.new unless virtualization
|
30
30
|
virtualization[:systems] ||= Mash.new
|
data/lib/ohai/provides_map.rb
CHANGED
@@ -136,8 +136,8 @@ module Ohai
|
|
136
136
|
private
|
137
137
|
|
138
138
|
def normalize_and_validate(attribute)
|
139
|
-
raise Ohai::Exceptions::AttributeSyntaxError, "Attribute contains duplicate '/' characters: #{attribute}" if
|
140
|
-
raise Ohai::Exceptions::AttributeSyntaxError, "Attribute contains a trailing '/': #{attribute}" if
|
139
|
+
raise Ohai::Exceptions::AttributeSyntaxError, "Attribute contains duplicate '/' characters: #{attribute}" if %r{//+}.match?(attribute)
|
140
|
+
raise Ohai::Exceptions::AttributeSyntaxError, "Attribute contains a trailing '/': #{attribute}" if %r{/$}.match?(attribute)
|
141
141
|
|
142
142
|
parts = attribute.split("/")
|
143
143
|
parts.shift if parts.length != 0 && parts[0].length == 0 # attribute begins with a '/'
|
data/lib/ohai/runner.rb
CHANGED
data/lib/ohai/util/ip_helper.rb
CHANGED
@@ -14,11 +14,11 @@
|
|
14
14
|
# See the License for the specific language governing permissions and
|
15
15
|
# limitations under the License.
|
16
16
|
|
17
|
-
require "ipaddress"
|
18
|
-
|
19
17
|
module Ohai
|
20
18
|
module Util
|
21
19
|
module IpHelper
|
20
|
+
require "ipaddress" unless defined?(IPAddress)
|
21
|
+
|
22
22
|
# Corresponding to RFC 4192 + RFC 4193
|
23
23
|
IPV6_LINK_LOCAL_UNICAST_BLOCK = IPAddress("fe80::/10")
|
24
24
|
IPV6_PRIVATE_ADDRESS_BLOCK = IPAddress("fc00::/7")
|
data/lib/ohai/util/win32.rb
CHANGED
data/lib/ohai/version.rb
CHANGED
data/ohai.gemspec
CHANGED
@@ -14,7 +14,6 @@ Gem::Specification.new do |s|
|
|
14
14
|
|
15
15
|
s.required_ruby_version = ">= 2.5"
|
16
16
|
|
17
|
-
s.add_dependency "systemu", "~> 2.6.4"
|
18
17
|
s.add_dependency "ffi-yajl", "~> 2.2"
|
19
18
|
s.add_dependency "mixlib-cli", ">= 1.7.0" # 1.7+ needed to support passing multiple options
|
20
19
|
s.add_dependency "mixlib-config", ">= 2.0", "< 4.0"
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ohai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 16.
|
4
|
+
version: 16.4.11
|
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-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: systemu
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 2.6.4
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 2.6.4
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: ffi-yajl
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|