ohai 16.4.12 → 16.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/ohai.rb +1 -1
- data/lib/ohai/config.rb +1 -1
- data/lib/ohai/dsl.rb +1 -1
- data/lib/ohai/dsl/plugin.rb +5 -5
- data/lib/ohai/dsl/plugin/versionvii.rb +1 -1
- data/lib/ohai/exception.rb +1 -1
- data/lib/ohai/hints.rb +1 -1
- data/lib/ohai/loader.rb +1 -1
- data/lib/ohai/log.rb +1 -1
- data/lib/ohai/mixin/azure_metadata.rb +1 -1
- data/lib/ohai/mixin/chef_utils_wiring.rb +39 -0
- data/lib/ohai/mixin/command.rb +3 -54
- data/lib/ohai/mixin/constant_helper.rb +1 -1
- data/lib/ohai/mixin/dmi_decode.rb +1 -1
- data/lib/ohai/mixin/do_metadata.rb +1 -1
- data/lib/ohai/mixin/ec2_metadata.rb +1 -1
- data/lib/ohai/mixin/http_helper.rb +1 -1
- data/lib/ohai/mixin/network_helper.rb +1 -1
- data/lib/ohai/mixin/os.rb +1 -1
- data/lib/ohai/mixin/scaleway_metadata.rb +1 -1
- data/lib/ohai/mixin/seconds_to_human.rb +1 -1
- data/lib/ohai/mixin/shell_out.rb +50 -0
- data/lib/ohai/mixin/string.rb +1 -1
- data/lib/ohai/mixin/which.rb +38 -0
- data/lib/ohai/plugin_config.rb +1 -1
- data/lib/ohai/plugins/aix/kernel.rb +1 -1
- data/lib/ohai/plugins/aix/memory.rb +3 -3
- data/lib/ohai/plugins/aix/network.rb +1 -1
- data/lib/ohai/plugins/aix/platform.rb +1 -1
- data/lib/ohai/plugins/aix/uptime.rb +1 -1
- data/lib/ohai/plugins/aix/virtualization.rb +1 -1
- data/lib/ohai/plugins/azure.rb +1 -1
- data/lib/ohai/plugins/bsd/virtualization.rb +2 -2
- data/lib/ohai/plugins/cloud.rb +1 -1
- data/lib/ohai/plugins/command.rb +1 -1
- data/lib/ohai/plugins/cpu.rb +2 -2
- data/lib/ohai/plugins/darwin/memory.rb +1 -1
- data/lib/ohai/plugins/darwin/network.rb +1 -1
- data/lib/ohai/plugins/darwin/platform.rb +2 -2
- data/lib/ohai/plugins/darwin/virtualization.rb +1 -1
- data/lib/ohai/plugins/docker.rb +1 -1
- data/lib/ohai/plugins/ec2.rb +2 -2
- data/lib/ohai/plugins/erlang.rb +1 -1
- data/lib/ohai/plugins/eucalyptus.rb +1 -1
- data/lib/ohai/plugins/filesystem.rb +1 -1
- data/lib/ohai/plugins/fips.rb +1 -1
- data/lib/ohai/plugins/hostname.rb +1 -1
- data/lib/ohai/plugins/init_package.rb +1 -1
- data/lib/ohai/plugins/java.rb +1 -1
- data/lib/ohai/plugins/kernel.rb +2 -2
- data/lib/ohai/plugins/keys.rb +1 -1
- data/lib/ohai/plugins/languages.rb +1 -1
- data/lib/ohai/plugins/libvirt.rb +1 -1
- data/lib/ohai/plugins/linode.rb +1 -1
- data/lib/ohai/plugins/linux/block_device.rb +1 -1
- data/lib/ohai/plugins/linux/lsb.rb +1 -1
- data/lib/ohai/plugins/linux/memory.rb +1 -1
- data/lib/ohai/plugins/linux/network.rb +9 -9
- data/lib/ohai/plugins/linux/platform.rb +1 -1
- data/lib/ohai/plugins/linux/virtualization.rb +1 -1
- data/lib/ohai/plugins/network.rb +1 -1
- data/lib/ohai/plugins/ohai_time.rb +1 -1
- data/lib/ohai/plugins/openstack.rb +1 -1
- data/lib/ohai/plugins/os.rb +1 -1
- data/lib/ohai/plugins/packages.rb +20 -0
- data/lib/ohai/plugins/perl.rb +1 -1
- data/lib/ohai/plugins/platform.rb +1 -1
- data/lib/ohai/plugins/powershell.rb +1 -1
- data/lib/ohai/plugins/ps.rb +1 -1
- data/lib/ohai/plugins/python.rb +1 -1
- data/lib/ohai/plugins/shard.rb +1 -1
- data/lib/ohai/plugins/shells.rb +1 -1
- data/lib/ohai/plugins/softlayer.rb +1 -1
- data/lib/ohai/plugins/solaris2/network.rb +6 -8
- data/lib/ohai/plugins/solaris2/platform.rb +1 -1
- data/lib/ohai/plugins/solaris2/virtualization.rb +1 -1
- data/lib/ohai/plugins/ssh_host_key.rb +1 -1
- data/lib/ohai/plugins/uptime.rb +1 -1
- data/lib/ohai/plugins/virtualbox.rb +1 -1
- data/lib/ohai/plugins/vmware.rb +1 -1
- data/lib/ohai/plugins/windows/drivers.rb +1 -1
- data/lib/ohai/plugins/windows/network.rb +1 -1
- data/lib/ohai/plugins/windows/platform.rb +1 -1
- data/lib/ohai/plugins/windows/system_enclosure.rb +1 -1
- data/lib/ohai/plugins/windows/virtualization.rb +1 -1
- data/lib/ohai/plugins/zpools.rb +1 -1
- data/lib/ohai/provides_map.rb +1 -1
- data/lib/ohai/runner.rb +1 -1
- data/lib/ohai/system.rb +2 -3
- data/lib/ohai/util/file_helper.rb +4 -37
- data/lib/ohai/util/win32.rb +1 -1
- data/lib/ohai/version.rb +2 -2
- metadata +5 -2
@@ -2,7 +2,7 @@
|
|
2
2
|
# Author:: Kaustubh Deorukhkar (<kaustubh@clogeny.com>)
|
3
3
|
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
|
4
4
|
# Author:: Isa Farnik (<isa@chef.io>)
|
5
|
-
# Copyright:: Copyright (c)
|
5
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
6
6
|
# License:: Apache License, Version 2.0
|
7
7
|
#
|
8
8
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Joshua Timberman <joshua@chef.io>
|
3
3
|
# Author:: Isa Farnik (<isa@chef.io>)
|
4
|
-
# Copyright:: Copyright (c)
|
4
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
5
5
|
# License:: Apache License, Version 2.0
|
6
6
|
#
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Kurt Yoder (<ktyopscode@yoderhome.com>)
|
3
3
|
# Author:: Isa Farnik (<isa@chef.io>)
|
4
|
-
# Copyright:: Copyright (c)
|
4
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
5
5
|
# License:: Apache License, Version 2.0
|
6
6
|
#
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Julian C. Dunn (<jdunn@chef.io>)
|
3
3
|
# Author:: Isa Farnik (<isa@chef.io>)
|
4
|
-
# Copyright:: Copyright (c)
|
4
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
5
5
|
# License:: Apache License, Version 2.0
|
6
6
|
#
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
data/lib/ohai/plugins/azure.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Bryan McLellan (btm@loftninjas.org)
|
3
3
|
# Copyright:: Copyright (c) 2009 Bryan McLellan
|
4
|
-
# Copyright:: Copyright (c)
|
4
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
5
5
|
# License:: Apache License, Version 2.0
|
6
6
|
#
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -49,7 +49,7 @@ Ohai.plugin(:Virtualization) do
|
|
49
49
|
end
|
50
50
|
|
51
51
|
# detect from modules
|
52
|
-
so = shell_out(
|
52
|
+
so = shell_out(Ohai.abs_path("/sbin/kldstat").to_s)
|
53
53
|
so.stdout.lines do |line|
|
54
54
|
case line
|
55
55
|
when /vboxdrv/
|
data/lib/ohai/plugins/cloud.rb
CHANGED
data/lib/ohai/plugins/command.rb
CHANGED
data/lib/ohai/plugins/cpu.rb
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
|
9
9
|
# Author:: Isa Farnik (<isa@chef.io>)
|
10
10
|
# Author:: Doug MacEachern <dougm@vmware.com>
|
11
|
-
# Copyright:: Copyright (c)
|
11
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
12
12
|
# License:: Apache License, Version 2.0
|
13
13
|
#
|
14
14
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -61,7 +61,7 @@ Ohai.plugin(:CPU) do
|
|
61
61
|
cpu_number += 1
|
62
62
|
when /vendor_id\s+:\s(.+)/
|
63
63
|
vendor_id = $1
|
64
|
-
if vendor_id
|
64
|
+
if vendor_id.include?("IBM/S390")
|
65
65
|
cpuinfo["vendor_id"] = vendor_id
|
66
66
|
else
|
67
67
|
cpuinfo[current_cpu]["vendor_id"] = vendor_id
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Patrick Collins (<pat@burned.com>)
|
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");
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Adam Jacob (<adam@chef.io>)
|
3
|
-
# Copyright:: Copyright (c) Chef Software
|
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");
|
@@ -20,7 +20,7 @@ Ohai.plugin(:Platform) do
|
|
20
20
|
provides "platform", "platform_version", "platform_build", "platform_family"
|
21
21
|
|
22
22
|
collect_data(:darwin) do
|
23
|
-
so = shell_out(
|
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
26
|
when /^ProductVersion:\s+(.+)$/
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# Author:: Pavel Yudin (<pyudin@parallels.com>)
|
3
3
|
# Author:: Tim Smith (<tsmith@chef.io>)
|
4
4
|
# Copyright:: Copyright (c) 2015 Pavel Yudin
|
5
|
-
# Copyright:: Copyright (c)
|
5
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
6
6
|
# License:: Apache License, Version 2.0
|
7
7
|
#
|
8
8
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
data/lib/ohai/plugins/docker.rb
CHANGED
data/lib/ohai/plugins/ec2.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# Author:: Benjamin Black (<bb@chef.io>)
|
4
4
|
# Author:: Christopher Brown (<cb@chef.io>)
|
5
5
|
# Author:: Tim Smith (<tsmith@chef.io>)
|
6
|
-
# Copyright:: Copyright (c)
|
6
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
7
7
|
# License:: Apache License, Version 2.0
|
8
8
|
#
|
9
9
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -114,7 +114,7 @@ Ohai.plugin(:EC2) do
|
|
114
114
|
end
|
115
115
|
|
116
116
|
collect_data do
|
117
|
-
require "base64"
|
117
|
+
require "base64" unless defined?(Base64)
|
118
118
|
|
119
119
|
if looks_like_ec2?
|
120
120
|
logger.trace("Plugin EC2: looks_like_ec2? == true")
|
data/lib/ohai/plugins/erlang.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Joe Williams (<joe@joetify.com>)
|
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");
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# Author:: Tim Dysinger (<tim@dysinger.net>)
|
3
3
|
# Author:: Benjamin Black (<bb@chef.io>)
|
4
4
|
# Author:: Christopher Brown (<cb@chef.io>)
|
5
|
-
# Copyright:: Copyright (c)
|
5
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
6
6
|
# License:: Apache License, Version 2.0
|
7
7
|
#
|
8
8
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -6,7 +6,7 @@
|
|
6
6
|
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
|
7
7
|
# Author:: Isa Farnik (<isa@chef.io>)
|
8
8
|
# Author:: James Gartrell (<jgartrel@gmail.com>)
|
9
|
-
# Copyright:: Copyright (c)
|
9
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
10
10
|
# Copyright:: Copyright (c) 2015 Facebook, Inc.
|
11
11
|
# License:: Apache License, Version 2.0
|
12
12
|
#
|
data/lib/ohai/plugins/fips.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Matt Wrock (<matt@mattwrock.com>)
|
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");
|
@@ -6,7 +6,7 @@
|
|
6
6
|
# Author:: Doug MacEachern (<dougm@vmware.com>)
|
7
7
|
# Author:: James Gartrell (<jgartrel@gmail.com>)
|
8
8
|
# Author:: Isa Farnik (<isa@chef.io>)
|
9
|
-
# Copyright:: Copyright (c)
|
9
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
10
10
|
# Copyright:: Copyright (c) 2009 Bryan McLellan
|
11
11
|
# Copyright:: Copyright (c) 2009 Daniel DeLeo
|
12
12
|
# Copyright:: Copyright (c) 2010 VMware, Inc.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Caleb Tennis (<caleb.tennis@gmail.com>)
|
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");
|
data/lib/ohai/plugins/java.rb
CHANGED
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) Chef Software
|
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
|
#
|
@@ -42,7 +42,7 @@ Ohai.plugin(:Kernel) do
|
|
42
42
|
# @return [Mash]
|
43
43
|
def bsd_modules(path)
|
44
44
|
modules = Mash.new
|
45
|
-
so = shell_out(
|
45
|
+
so = shell_out(Ohai.abs_path(path).to_s)
|
46
46
|
so.stdout.lines do |line|
|
47
47
|
# 1 7 0xc0400000 97f830 kernel
|
48
48
|
if line =~ /(\d+)\s+(\d+)\s+([0-9a-fx]+)\s+([0-9a-fx]+)\s+([a-zA-Z0-9\_]+)/
|
data/lib/ohai/plugins/keys.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# Cookbook Name:: apache2
|
3
3
|
# Recipe:: default
|
4
4
|
#
|
5
|
-
# Copyright
|
5
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
6
6
|
#
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
# you may not use this file except in compliance with the License.
|
data/lib/ohai/plugins/libvirt.rb
CHANGED
data/lib/ohai/plugins/linode.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Adam Jacob (<adam@chef.io>)
|
3
3
|
# Author:: Chris Read <chris.read@gmail.com>
|
4
|
-
# Copyright:: Copyright (c)
|
4
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
5
5
|
# License:: Apache License, Version 2.0
|
6
6
|
#
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -141,12 +141,12 @@ Ohai.plugin(:Network) do
|
|
141
141
|
# using a temporary var to hold routes and their interface name
|
142
142
|
def parse_routes(family, iface)
|
143
143
|
iface.collect do |i, iv|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
end
|
149
|
-
end.compact.flatten
|
144
|
+
next unless iv[:routes]
|
145
|
+
|
146
|
+
iv[:routes].collect do |r|
|
147
|
+
r.merge(dev: i) if r[:family] == family[:name]
|
148
|
+
end.compact # @todo: when we drop ruby 2.6 this should be a filter_map
|
149
|
+
end.compact.flatten # @todo: when we drop ruby 2.6 this should be a filter_map
|
150
150
|
end
|
151
151
|
|
152
152
|
# determine layer 1 details for the interface using ethtool
|
@@ -264,7 +264,7 @@ Ohai.plugin(:Network) do
|
|
264
264
|
end
|
265
265
|
key, val = line.split(/:\s+/)
|
266
266
|
if val
|
267
|
-
coalesce_key =
|
267
|
+
coalesce_key = key.downcase.tr(" ", "_").to_s
|
268
268
|
iface[tmp_int]["coalesce_params"][coalesce_key] = val.to_i
|
269
269
|
end
|
270
270
|
end
|
@@ -289,7 +289,7 @@ Ohai.plugin(:Network) do
|
|
289
289
|
if val.nil?
|
290
290
|
val = ""
|
291
291
|
end
|
292
|
-
driver_key =
|
292
|
+
driver_key = key.downcase.tr(" ", "_").to_s
|
293
293
|
iface[tmp_int]["driver_info"][driver_key] = val.chomp
|
294
294
|
end
|
295
295
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Thom May (<thom@clearairturbulence.org>)
|
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");
|
data/lib/ohai/plugins/network.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Matt Ray (<matt@chef.io>)
|
3
3
|
# Author:: Tim Smith (<tsmith@chef.io>)
|
4
|
-
# Copyright:: Copyright (c)
|
4
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
5
5
|
# License:: Apache License, Version 2.0
|
6
6
|
#
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
data/lib/ohai/plugins/os.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# Author:: Adam Jacob (<adam@chef.io>)
|
3
3
|
# Author:: Isa Farnik (<isa@chef.io>)
|
4
4
|
# Author:: Richard Manyanza (<liseki@nyikacraftsmen.com>)
|
5
|
-
# Copyright:: Copyright (c)
|
5
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
6
6
|
# Copyright:: Copyright (c) 2014 Richard Manyanza.
|
7
7
|
# License:: Apache License, Version 2.0
|
8
8
|
#
|
@@ -209,4 +209,24 @@ Ohai.plugin(:Packages) do
|
|
209
209
|
collect_ips_packages
|
210
210
|
collect_sysv_packages
|
211
211
|
end
|
212
|
+
|
213
|
+
def collect_system_profiler_apps
|
214
|
+
require "plist"
|
215
|
+
sp_std = shell_out("system_profiler SPApplicationsDataType -xml")
|
216
|
+
results = Plist.parse_xml(sp_std.stdout)
|
217
|
+
sw_array = results[0]["_items"]
|
218
|
+
sw_array.each do |pkg|
|
219
|
+
packages[pkg["_name"]] = {
|
220
|
+
"version" => pkg["version"],
|
221
|
+
"lastmodified" => pkg["lastModified"],
|
222
|
+
"source" => pkg["obtained_from"],
|
223
|
+
}
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
collect_data(:darwin) do
|
228
|
+
packages Mash.new
|
229
|
+
collect_system_profiler_apps
|
230
|
+
end
|
231
|
+
|
212
232
|
end
|