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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57f034c4995360aa8eb45d92d95ddee35d307411506e57be5a55b9a5e58b52f3
|
4
|
+
data.tar.gz: dcffcadad6b0a1038b1715397ec2e9ee54000d42ac7cf3f2229e7bbe42e69395
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9198da99387e9dfcc99350cba0a7e1e95f2a1e1de7fecf4ecf76b311d38352214b1f76179aa20bcd42f0017f7a8c5d9e73f251c016eb9e8c83d4e0be234da0a8
|
7
|
+
data.tar.gz: bbd44815894afe658ab51d54088589f4c66d62a5099a81c93c48801a8aa454f9c8af38498b667a2fe51088889145a5b05cf376860459c4889453a088c066f9f5
|
data/Gemfile
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
source "https://rubygems.org"
|
2
3
|
|
3
4
|
gemspec
|
@@ -19,15 +20,9 @@ group :development do
|
|
19
20
|
gem "rubocop-rspec"
|
20
21
|
end
|
21
22
|
|
22
|
-
group :docs do
|
23
|
-
gem "github-markup"
|
24
|
-
gem "redcarpet"
|
25
|
-
gem "yard"
|
26
|
-
end
|
27
|
-
|
28
23
|
group :debug do
|
29
24
|
gem "pry"
|
30
25
|
gem "pry-byebug"
|
31
|
-
gem "pry-stack_explorer"
|
26
|
+
gem "pry-stack_explorer"
|
32
27
|
gem "rb-readline"
|
33
28
|
end
|
data/bin/ohai
CHANGED
data/lib/ohai.rb
CHANGED
data/lib/ohai/application.rb
CHANGED
data/lib/ohai/common/dmi.rb
CHANGED
data/lib/ohai/config.rb
CHANGED
data/lib/ohai/dsl.rb
CHANGED
data/lib/ohai/dsl/plugin.rb
CHANGED
data/lib/ohai/exception.rb
CHANGED
data/lib/ohai/hints.rb
CHANGED
data/lib/ohai/log.rb
CHANGED
data/lib/ohai/mash.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# Author:: Tim Smith (<tsmith@chef.io>)
|
3
4
|
# Copyright:: Copyright (c) Chef Software Inc.
|
@@ -31,7 +32,7 @@ module Ohai
|
|
31
32
|
#
|
32
33
|
module AzureMetadata
|
33
34
|
|
34
|
-
AZURE_METADATA_ADDR ||= "169.254.169.254"
|
35
|
+
AZURE_METADATA_ADDR ||= "169.254.169.254"
|
35
36
|
|
36
37
|
# it's important that the newer versions are at the end of this array so we can skip sorting it
|
37
38
|
AZURE_SUPPORTED_VERSIONS ||= %w{ 2017-04-02 2017-08-01 2017-12-01 2018-02-01 2018-04-02
|
data/lib/ohai/mixin/command.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
$stderr.puts "WARN: Ohai::Mixin::Command is deprecated, please use Ohai::Mixin::ShellOut or remove if the reference is unnecessary"
|
2
3
|
require_relative "shell_out"
|
3
4
|
Ohai::Mixin::Command = Ohai::Mixin::ShellOut unless defined?(Ohai::Mixin::Command)
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
|
2
3
|
# Author:: Dylan Page (<dpage@digitalocean.com>)
|
3
4
|
# License:: Apache License, Version 2.0
|
@@ -20,8 +21,8 @@ module Ohai
|
|
20
21
|
module Mixin
|
21
22
|
module DOMetadata
|
22
23
|
|
23
|
-
DO_METADATA_ADDR ||= "169.254.169.254"
|
24
|
-
DO_METADATA_URL ||= "/metadata/v1.json"
|
24
|
+
DO_METADATA_ADDR ||= "169.254.169.254"
|
25
|
+
DO_METADATA_URL ||= "/metadata/v1.json"
|
25
26
|
|
26
27
|
def http_client
|
27
28
|
Net::HTTP.start(DO_METADATA_ADDR).tap { |h| h.read_timeout = 6 }
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# Author:: Tim Dysinger (<tim@dysinger.net>)
|
3
4
|
# Author:: Benjamin Black (<bb@chef.io>)
|
@@ -39,7 +40,7 @@ module Ohai
|
|
39
40
|
#
|
40
41
|
module Ec2Metadata
|
41
42
|
|
42
|
-
EC2_METADATA_ADDR ||= "169.254.169.254"
|
43
|
+
EC2_METADATA_ADDR ||= "169.254.169.254"
|
43
44
|
EC2_SUPPORTED_VERSIONS ||= %w{ 1.0 2007-01-19 2007-03-01 2007-08-29 2007-10-10 2007-12-15
|
44
45
|
2008-02-01 2008-09-01 2009-04-04 2011-01-01 2011-05-01 2012-01-12
|
45
46
|
2014-02-25 2014-11-05 2015-10-20 2016-04-19 2016-06-30 2016-09-02 }.freeze
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# Author:: Ranjib Dey (<dey.ranjib@gmail.com>)
|
3
4
|
# License:: Apache License, Version 2.0
|
@@ -21,8 +22,8 @@ module Ohai
|
|
21
22
|
module GCEMetadata
|
22
23
|
|
23
24
|
# Trailing dot to host is added to avoid DNS search path
|
24
|
-
GCE_METADATA_ADDR ||= "metadata.google.internal."
|
25
|
-
GCE_METADATA_URL ||= "/computeMetadata/v1/?recursive=true"
|
25
|
+
GCE_METADATA_ADDR ||= "metadata.google.internal."
|
26
|
+
GCE_METADATA_URL ||= "/computeMetadata/v1/?recursive=true"
|
26
27
|
|
27
28
|
# fetch the meta content with a timeout and the required header
|
28
29
|
def http_get(uri)
|
data/lib/ohai/mixin/os.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# Author:: Jonathan Amiez (<jonathan.amiez@gmail.com>)
|
3
4
|
# License:: Apache License, Version 2.0
|
@@ -20,8 +21,8 @@ module Ohai
|
|
20
21
|
module Mixin
|
21
22
|
module ScalewayMetadata
|
22
23
|
|
23
|
-
SCALEWAY_METADATA_ADDR ||= "169.254.42.42"
|
24
|
-
SCALEWAY_METADATA_URL ||= "/conf?format=json"
|
24
|
+
SCALEWAY_METADATA_ADDR ||= "169.254.42.42"
|
25
|
+
SCALEWAY_METADATA_URL ||= "/conf?format=json"
|
25
26
|
|
26
27
|
# @return [Net::HTTP] net/http object without timeout set to 6
|
27
28
|
def http_client
|
data/lib/ohai/mixin/shell_out.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# Author:: Alexey Karpik <alexey.karpik@rightscale.com>
|
3
4
|
# Author:: Peter Schroeter <peter.schroeter@rightscale.com>
|
@@ -22,7 +23,7 @@ require "uri" unless defined?(URI)
|
|
22
23
|
|
23
24
|
# https://softlayer.github.io/reference/services/SoftLayer_Resource_Metadata/
|
24
25
|
module ::Ohai::Mixin::SoftlayerMetadata
|
25
|
-
SOFTLAYER_API_QUERY_URL ||= "https://api.service.softlayer.com/rest/v3.1/SoftLayer_Resource_Metadata"
|
26
|
+
SOFTLAYER_API_QUERY_URL ||= "https://api.service.softlayer.com/rest/v3.1/SoftLayer_Resource_Metadata"
|
26
27
|
|
27
28
|
# fetch metadata items and build out hash of data
|
28
29
|
#
|
data/lib/ohai/mixin/string.rb
CHANGED
data/lib/ohai/mixin/which.rb
CHANGED
data/lib/ohai/plugin_config.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# Author:: Kaustubh Deorukhkar (<kaustubh@clogeny.com>)
|
3
4
|
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
|
@@ -92,7 +93,7 @@ Ohai.plugin(:Network) do
|
|
92
93
|
if lin =~ /broadcast\s(\S+)\s/
|
93
94
|
iface[interface][:addresses][tmp_addr][:broadcast] = $1
|
94
95
|
end
|
95
|
-
elsif lin =~ %r{inet6 ([a-f0-9\:]+)%?(
|
96
|
+
elsif lin =~ %r{inet6 ([a-f0-9\:]+)%?(\d*)/?(\d*)?}
|
96
97
|
# TODO do we have more properties on inet6 in aix? broadcast
|
97
98
|
iface[interface][:addresses] ||= Mash.new
|
98
99
|
iface[interface][:addresses][$1] = { "family" => "inet6", "zone_index" => $2, "prefixlen" => $3 }
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# Author:: Kurt Yoder (<ktyopscode@yoderhome.com>)
|
3
4
|
# Author:: Isa Farnik (<isa@chef.io>)
|
@@ -40,9 +41,9 @@ Ohai.plugin(:Uptime) do
|
|
40
41
|
when /^\d+-\d/
|
41
42
|
(d, h, m, s) = so.split(/[-:]/)
|
42
43
|
when /^\d+:\d+:\d/
|
43
|
-
(h, m, s) = so.split(
|
44
|
+
(h, m, s) = so.split(":")
|
44
45
|
else
|
45
|
-
(m, s) = so.split(
|
46
|
+
(m, s) = so.split(":")
|
46
47
|
end
|
47
48
|
elapsed_seconds = ((d.to_i * 86400) + (h.to_i * 3600) + (m.to_i * 60) + s.to_i)
|
48
49
|
|
data/lib/ohai/plugins/azure.rb
CHANGED
data/lib/ohai/plugins/c.rb
CHANGED
data/lib/ohai/plugins/chef.rb
CHANGED
data/lib/ohai/plugins/cloud.rb
CHANGED
data/lib/ohai/plugins/command.rb
CHANGED
data/lib/ohai/plugins/cpu.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# Author:: Adam Jacob (<adam@chef.io>)
|
3
4
|
# Author:: Bryan McLellan (btm@loftninjas.org)
|
@@ -35,11 +36,9 @@ Ohai.plugin(:CPU) do
|
|
35
36
|
when /CPU:\s+(.+) \(([\d.]+).+\)/
|
36
37
|
cpuinfo["model_name"] = $1
|
37
38
|
cpuinfo["mhz"] = $2
|
38
|
-
when /Features=.+<(.+)>/
|
39
|
+
when /Features=.+<(.+)>/, /Features2=[a-f\dx]+<(.+)>/
|
39
40
|
cpuinfo["flags"].concat($1.downcase.split(","))
|
40
41
|
# Features2=0x80000001<SSE3,<b31>>
|
41
|
-
when /Features2=[a-f\dx]+<(.+)>/
|
42
|
-
cpuinfo["flags"].concat($1.downcase.split(","))
|
43
42
|
else
|
44
43
|
yield(cpuinfo, line)
|
45
44
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# Author:: Patrick Collins (<pat@burned.com>)
|
3
4
|
# Copyright:: Copyright (c) Chef Software Inc.
|
@@ -43,9 +44,7 @@ Ohai.plugin(:Memory) do
|
|
43
44
|
megabyte_val = (pages * page_size) / 1024 / 1024.0
|
44
45
|
total_consumed += megabyte_val
|
45
46
|
case match
|
46
|
-
when "wired down"
|
47
|
-
active += megabyte_val.to_i
|
48
|
-
when "active"
|
47
|
+
when "wired down", "active"
|
49
48
|
active += megabyte_val.to_i
|
50
49
|
when "inactive"
|
51
50
|
inactive += megabyte_val.to_i
|
data/lib/ohai/plugins/dmi.rb
CHANGED
data/lib/ohai/plugins/docker.rb
CHANGED