ohai 16.6.5 → 16.7.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -7
- data/bin/ohai +1 -0
- data/lib/ohai.rb +1 -0
- data/lib/ohai/application.rb +1 -0
- data/lib/ohai/common/dmi.rb +1 -0
- data/lib/ohai/config.rb +1 -0
- data/lib/ohai/dsl.rb +1 -0
- data/lib/ohai/dsl/plugin.rb +1 -0
- data/lib/ohai/dsl/plugin/versionvii.rb +1 -0
- data/lib/ohai/exception.rb +1 -0
- data/lib/ohai/hints.rb +1 -0
- data/lib/ohai/log.rb +1 -0
- data/lib/ohai/mash.rb +1 -0
- data/lib/ohai/mixin/azure_metadata.rb +2 -1
- data/lib/ohai/mixin/chef_utils_wiring.rb +1 -0
- data/lib/ohai/mixin/command.rb +1 -0
- data/lib/ohai/mixin/constant_helper.rb +1 -0
- data/lib/ohai/mixin/dmi_decode.rb +1 -0
- data/lib/ohai/mixin/do_metadata.rb +3 -2
- data/lib/ohai/mixin/ec2_metadata.rb +2 -1
- data/lib/ohai/mixin/gce_metadata.rb +3 -2
- data/lib/ohai/mixin/http_helper.rb +1 -0
- data/lib/ohai/mixin/network_helper.rb +1 -0
- data/lib/ohai/mixin/os.rb +1 -0
- data/lib/ohai/mixin/scaleway_metadata.rb +3 -2
- data/lib/ohai/mixin/seconds_to_human.rb +1 -0
- data/lib/ohai/mixin/shell_out.rb +1 -0
- data/lib/ohai/mixin/softlayer_metadata.rb +2 -1
- data/lib/ohai/mixin/string.rb +1 -0
- data/lib/ohai/mixin/train_helpers.rb +1 -0
- data/lib/ohai/mixin/which.rb +1 -0
- data/lib/ohai/plugin_config.rb +1 -0
- data/lib/ohai/plugins/aix/kernel.rb +1 -0
- data/lib/ohai/plugins/aix/memory.rb +1 -0
- data/lib/ohai/plugins/aix/network.rb +2 -1
- data/lib/ohai/plugins/aix/platform.rb +1 -0
- data/lib/ohai/plugins/aix/uptime.rb +3 -2
- data/lib/ohai/plugins/azure.rb +1 -0
- data/lib/ohai/plugins/bsd/virtualization.rb +1 -0
- data/lib/ohai/plugins/c.rb +1 -0
- data/lib/ohai/plugins/chef.rb +1 -0
- data/lib/ohai/plugins/cloud.rb +1 -0
- data/lib/ohai/plugins/command.rb +1 -0
- data/lib/ohai/plugins/cpu.rb +2 -3
- data/lib/ohai/plugins/darwin/hardware.rb +1 -0
- data/lib/ohai/plugins/darwin/memory.rb +2 -3
- data/lib/ohai/plugins/darwin/network.rb +1 -0
- data/lib/ohai/plugins/darwin/platform.rb +1 -0
- data/lib/ohai/plugins/darwin/virtualization.rb +1 -0
- data/lib/ohai/plugins/digital_ocean.rb +1 -0
- data/lib/ohai/plugins/dmi.rb +1 -0
- data/lib/ohai/plugins/docker.rb +1 -0
- data/lib/ohai/plugins/dragonflybsd/memory.rb +1 -0
- data/lib/ohai/plugins/dragonflybsd/network.rb +1 -0
- data/lib/ohai/plugins/dragonflybsd/platform.rb +1 -0
- data/lib/ohai/plugins/ec2.rb +1 -0
- data/lib/ohai/plugins/elixir.rb +1 -1
- data/lib/ohai/plugins/erlang.rb +1 -0
- data/lib/ohai/plugins/eucalyptus.rb +4 -1
- data/lib/ohai/plugins/filesystem.rb +1 -1
- data/lib/ohai/plugins/fips.rb +1 -0
- data/lib/ohai/plugins/freebsd/memory.rb +1 -0
- data/lib/ohai/plugins/freebsd/network.rb +1 -0
- data/lib/ohai/plugins/freebsd/platform.rb +1 -0
- data/lib/ohai/plugins/gce.rb +1 -0
- data/lib/ohai/plugins/go.rb +1 -1
- data/lib/ohai/plugins/groovy.rb +1 -1
- data/lib/ohai/plugins/haskell.rb +1 -0
- data/lib/ohai/plugins/hostname.rb +1 -0
- data/lib/ohai/plugins/init_package.rb +1 -0
- data/lib/ohai/plugins/java.rb +1 -0
- data/lib/ohai/plugins/joyent.rb +1 -0
- data/lib/ohai/plugins/kernel.rb +2 -1
- data/lib/ohai/plugins/keys.rb +1 -0
- data/lib/ohai/plugins/languages.rb +1 -0
- data/lib/ohai/plugins/libvirt.rb +1 -0
- data/lib/ohai/plugins/linode.rb +1 -0
- data/lib/ohai/plugins/linux/block_device.rb +1 -0
- data/lib/ohai/plugins/linux/hostnamectl.rb +3 -2
- data/lib/ohai/plugins/linux/interrupts.rb +1 -0
- data/lib/ohai/plugins/linux/ipc.rb +1 -0
- data/lib/ohai/plugins/linux/lsb.rb +6 -19
- data/lib/ohai/plugins/linux/lspci.rb +1 -0
- data/lib/ohai/plugins/linux/machineid.rb +1 -0
- data/lib/ohai/plugins/linux/mdadm.rb +1 -0
- data/lib/ohai/plugins/linux/memory.rb +37 -36
- data/lib/ohai/plugins/linux/network.rb +1 -0
- data/lib/ohai/plugins/linux/platform.rb +2 -1
- data/lib/ohai/plugins/linux/selinux.rb +1 -0
- data/lib/ohai/plugins/linux/sessions.rb +1 -0
- data/lib/ohai/plugins/linux/sysctl.rb +1 -0
- data/lib/ohai/plugins/linux/systemd_paths.rb +1 -0
- data/lib/ohai/plugins/linux/virtualization.rb +1 -0
- data/lib/ohai/plugins/lua.rb +1 -1
- data/lib/ohai/plugins/mono.rb +1 -1
- data/lib/ohai/plugins/netbsd/memory.rb +1 -0
- data/lib/ohai/plugins/netbsd/network.rb +1 -0
- data/lib/ohai/plugins/netbsd/platform.rb +1 -0
- data/lib/ohai/plugins/network.rb +1 -0
- data/lib/ohai/plugins/nodejs.rb +1 -1
- data/lib/ohai/plugins/ohai.rb +1 -0
- data/lib/ohai/plugins/ohai_time.rb +1 -0
- data/lib/ohai/plugins/openbsd/memory.rb +1 -0
- data/lib/ohai/plugins/openbsd/network.rb +1 -0
- data/lib/ohai/plugins/openbsd/platform.rb +1 -0
- data/lib/ohai/plugins/openstack.rb +1 -0
- data/lib/ohai/plugins/os.rb +1 -0
- data/lib/ohai/plugins/packages.rb +1 -0
- data/lib/ohai/plugins/passwd.rb +1 -0
- data/lib/ohai/plugins/perl.rb +1 -1
- data/lib/ohai/plugins/php.rb +1 -1
- data/lib/ohai/plugins/platform.rb +1 -0
- data/lib/ohai/plugins/powershell.rb +1 -1
- data/lib/ohai/plugins/ps.rb +1 -0
- data/lib/ohai/plugins/python.rb +1 -1
- data/lib/ohai/plugins/rackspace.rb +2 -1
- data/lib/ohai/plugins/root_group.rb +1 -0
- data/lib/ohai/plugins/ruby.rb +3 -2
- data/lib/ohai/plugins/rust.rb +1 -1
- data/lib/ohai/plugins/scala.rb +1 -0
- data/lib/ohai/plugins/scaleway.rb +1 -0
- data/lib/ohai/plugins/scsi.rb +1 -0
- data/lib/ohai/plugins/shard.rb +1 -1
- data/lib/ohai/plugins/shells.rb +1 -0
- data/lib/ohai/plugins/softlayer.rb +1 -0
- data/lib/ohai/plugins/solaris2/dmi.rb +1 -0
- data/lib/ohai/plugins/solaris2/memory.rb +1 -0
- data/lib/ohai/plugins/solaris2/network.rb +1 -0
- data/lib/ohai/plugins/solaris2/platform.rb +6 -12
- data/lib/ohai/plugins/solaris2/virtualization.rb +2 -1
- data/lib/ohai/plugins/ssh_host_key.rb +1 -0
- data/lib/ohai/plugins/sysconf.rb +1 -0
- data/lib/ohai/plugins/timezone.rb +1 -0
- data/lib/ohai/plugins/train.rb +1 -0
- data/lib/ohai/plugins/uptime.rb +1 -0
- data/lib/ohai/plugins/virtualbox.rb +1 -0
- data/lib/ohai/plugins/vmware.rb +1 -0
- data/lib/ohai/plugins/windows/dmi.rb +1 -0
- data/lib/ohai/plugins/windows/drivers.rb +1 -0
- data/lib/ohai/plugins/windows/memory.rb +1 -0
- data/lib/ohai/plugins/windows/network.rb +2 -1
- data/lib/ohai/plugins/windows/platform.rb +1 -0
- data/lib/ohai/plugins/windows/system_enclosure.rb +1 -0
- data/lib/ohai/plugins/windows/virtualization.rb +1 -0
- data/lib/ohai/plugins/zpools.rb +5 -2
- data/lib/ohai/provides_map.rb +1 -0
- data/lib/ohai/runner.rb +3 -4
- data/lib/ohai/system.rb +1 -0
- data/lib/ohai/train_transport.rb +1 -0
- data/lib/ohai/util/file_helper.rb +1 -0
- data/lib/ohai/util/ip_helper.rb +1 -0
- data/lib/ohai/util/win32.rb +1 -0
- data/lib/ohai/version.rb +2 -1
- data/ohai.gemspec +1 -0
- metadata +2 -2
data/lib/ohai/plugins/mono.rb
CHANGED
data/lib/ohai/plugins/network.rb
CHANGED
data/lib/ohai/plugins/nodejs.rb
CHANGED
data/lib/ohai/plugins/ohai.rb
CHANGED
data/lib/ohai/plugins/os.rb
CHANGED
data/lib/ohai/plugins/passwd.rb
CHANGED
data/lib/ohai/plugins/perl.rb
CHANGED
data/lib/ohai/plugins/php.rb
CHANGED
data/lib/ohai/plugins/ps.rb
CHANGED
data/lib/ohai/plugins/python.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# Author:: Cary Penniman (<cary@rightscale.com>)
|
3
4
|
# License:: Apache License, Version 2.0
|
@@ -25,7 +26,7 @@ Ohai.plugin(:Rackspace) do
|
|
25
26
|
# true:: If kernel name matches
|
26
27
|
# false:: Otherwise
|
27
28
|
def has_rackspace_kernel?
|
28
|
-
kernel[:release].
|
29
|
+
kernel[:release].end_with?("-rscloud")
|
29
30
|
end
|
30
31
|
|
31
32
|
# Checks for rackspace provider attribute
|
data/lib/ohai/plugins/ruby.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# Author:: Adam Jacob (<adam@chef.io>)
|
3
4
|
# Copyright:: Copyright (c) Chef Software Inc.
|
@@ -48,13 +49,13 @@ Ohai.plugin(:Ruby) do
|
|
48
49
|
}
|
49
50
|
|
50
51
|
# Create a query string from above hash
|
51
|
-
env_string =
|
52
|
+
env_string = []
|
52
53
|
values.each_key do |v|
|
53
54
|
env_string << "#{v}=\#{#{values[v]}},"
|
54
55
|
end
|
55
56
|
|
56
57
|
# Query the system ruby
|
57
|
-
result = run_ruby "require 'rubygems'; puts %Q(#{env_string})"
|
58
|
+
result = run_ruby "require 'rubygems'; puts %Q(#{env_string.join})"
|
58
59
|
|
59
60
|
# Parse results to plugin hash
|
60
61
|
result.split(",").each do |entry|
|
data/lib/ohai/plugins/rust.rb
CHANGED
data/lib/ohai/plugins/scala.rb
CHANGED
data/lib/ohai/plugins/scsi.rb
CHANGED
data/lib/ohai/plugins/shard.rb
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
Ohai.plugin(:ShardSeed) do
|
20
20
|
depends "hostname", "dmi", "machine_id", "machinename", "fips", "hardware", "kernel"
|
21
|
-
provides "shard_seed"
|
21
|
+
provides "shard_seed".freeze
|
22
22
|
|
23
23
|
def get_dmi_property(dmi, thing)
|
24
24
|
%w{system base_board chassis}.each do |section|
|
data/lib/ohai/plugins/shells.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# Author:: Benjamin Black (<nostromo@gmail.com>)
|
3
4
|
# Copyright:: Copyright (c) Chef Software Inc.
|
@@ -38,23 +39,16 @@ Ohai.plugin(:Platform) do
|
|
38
39
|
file_open("/etc/release") do |file|
|
39
40
|
while ( line = file.gets )
|
40
41
|
case line
|
41
|
-
when
|
42
|
+
when /.*SmartOS.*/
|
42
43
|
platform "smartos"
|
43
|
-
when /^\s*
|
44
|
+
when /^\s*OmniOS.*r(\d+).*$/
|
44
45
|
platform "omnios"
|
45
|
-
platform_version $
|
46
|
-
when /^\s*
|
46
|
+
platform_version $1
|
47
|
+
when /^\s*OpenIndiana.*(Development oi_|Hipster )(\d\S*)/ # https://rubular.com/r/iMtOBwbnyqDz7u
|
47
48
|
platform "openindiana"
|
48
49
|
platform_version $2
|
49
|
-
when /^\s*(
|
50
|
-
platform "opensolaris"
|
51
|
-
platform_version $2
|
52
|
-
when /^\s*(Oracle Solaris)/
|
53
|
-
platform "solaris2"
|
54
|
-
when /^\s*(Solaris)\s.*$/
|
50
|
+
when /^\s*(Oracle Solaris|Solaris)/
|
55
51
|
platform "solaris2"
|
56
|
-
when /^\s*(NexentaCore)\s.*$/
|
57
|
-
platform "nexentacore"
|
58
52
|
end
|
59
53
|
end
|
60
54
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# Author:: Sean Walbran (<seanwalbran@gmail.com>)
|
3
4
|
# Author:: Kurt Yoder (<ktyopscode@yoderhome.com>)
|
@@ -55,7 +56,7 @@ Ohai.plugin(:Virtualization) do
|
|
55
56
|
if File.executable?("/usr/sbin/zoneadm")
|
56
57
|
zones = Mash.new
|
57
58
|
shell_out("zoneadm list -pc").stdout.lines do |line|
|
58
|
-
info = line.chomp.split(
|
59
|
+
info = line.chomp.split(":")
|
59
60
|
zones[info[1]] = {
|
60
61
|
"id" => info[0],
|
61
62
|
"state" => info[2],
|
data/lib/ohai/plugins/sysconf.rb
CHANGED
data/lib/ohai/plugins/train.rb
CHANGED
data/lib/ohai/plugins/uptime.rb
CHANGED
data/lib/ohai/plugins/vmware.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# Author:: James Gartrell (<jgartrel@gmail.com>)
|
3
4
|
# Copyright:: Copyright (c) Chef Software Inc.
|
@@ -205,7 +206,7 @@ Ohai.plugin(:Network) do
|
|
205
206
|
so = shell_out("arp -a")
|
206
207
|
if so.exitstatus == 0
|
207
208
|
so.stdout.lines do |line|
|
208
|
-
if line =~ /^Interface:\s+(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s
|
209
|
+
if line =~ /^Interface:\s+(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s+-+\s+(0x\S+)/
|
209
210
|
cint = $2.downcase
|
210
211
|
end
|
211
212
|
next unless iface[cint]
|
data/lib/ohai/plugins/zpools.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# Author:: Jason J. W. Williams (williamsjj@digitar.com)
|
3
4
|
# Copyright:: Copyright (c) Chef Software Inc.
|
@@ -65,7 +66,9 @@ Ohai.plugin(:Zpools) do
|
|
65
66
|
if platform_family == "solaris2"
|
66
67
|
command = "su adm -c \"zpool status #{pool}\""
|
67
68
|
else
|
68
|
-
|
69
|
+
# -L is used to give us real device names not label or uuid
|
70
|
+
# for example sda instead of ata-WDC_WD60EZAZ-00SF3B0_WD-WX32D203UXYK
|
71
|
+
command = "zpool status #{pool} -L"
|
69
72
|
end
|
70
73
|
|
71
74
|
so = shell_out(command)
|
@@ -74,7 +77,7 @@ Ohai.plugin(:Zpools) do
|
|
74
77
|
# linux: http://rubular.com/r/J3wQC6E2lH
|
75
78
|
# solaris: http://rubular.com/r/FqOBzUQQ4p
|
76
79
|
# freebsd: http://rubular.com/r/RYkMNlytXl
|
77
|
-
when /^\s+((sd|c|ad|da)[-_a-zA-Z0-9]+)\s+([-_a-zA-Z0-9]+)\s+(\d+)\s+(\d+)\s+(\d+)$/
|
80
|
+
when /^\s+((sd|c|ad|da|nvme|xvd)[-_a-zA-Z0-9]+)\s+([-_a-zA-Z0-9]+)\s+(\d+)\s+(\d+)\s+(\d+)$/
|
78
81
|
logger.trace("Plugin Zpools: Parsing zpool status line: #{line.chomp}")
|
79
82
|
pools[pool][:devices][$1] = Mash.new
|
80
83
|
pools[pool][:devices][$1][:state] = $3
|
data/lib/ohai/provides_map.rb
CHANGED
data/lib/ohai/runner.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# Author:: Claire McQuin (<claire@chef.io>)
|
3
4
|
# Copyright:: Copyright (c) Chef Software Inc.
|
@@ -57,15 +58,13 @@ module Ohai
|
|
57
58
|
else
|
58
59
|
raise Ohai::Exceptions::InvalidPlugin, "Invalid plugin version #{plugin.version} for plugin #{plugin}"
|
59
60
|
end
|
60
|
-
rescue Ohai::Exceptions::Error #
|
61
|
-
raise
|
62
|
-
rescue SystemExit # abort or exit from plug-in should exit Ohai with failure code
|
61
|
+
rescue Ohai::Exceptions::Error, SystemExit # SystemExit: abort or exit from plug-in should exit Ohai with failure code
|
63
62
|
raise
|
64
63
|
rescue Exception => e
|
65
64
|
logger.trace("Plugin #{plugin.name} threw exception #{e.inspect} #{e.backtrace.join("\n")}")
|
66
65
|
end
|
67
66
|
end
|
68
|
-
logger.trace("Plugin #{plugin.name} took #{elapsed} seconds to run.")
|
67
|
+
logger.trace("Plugin #{plugin.name} took #{"%f" % elapsed.truncate(6)} seconds to run.")
|
69
68
|
end
|
70
69
|
|
71
70
|
# @param [Ohai::DSL::Plugin] plugin
|