ohai 16.4.12 → 16.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/lib/ohai.rb +1 -1
  4. data/lib/ohai/config.rb +1 -1
  5. data/lib/ohai/dsl.rb +1 -1
  6. data/lib/ohai/dsl/plugin.rb +5 -5
  7. data/lib/ohai/dsl/plugin/versionvii.rb +1 -1
  8. data/lib/ohai/exception.rb +1 -1
  9. data/lib/ohai/hints.rb +1 -1
  10. data/lib/ohai/loader.rb +1 -1
  11. data/lib/ohai/log.rb +1 -1
  12. data/lib/ohai/mixin/azure_metadata.rb +1 -1
  13. data/lib/ohai/mixin/chef_utils_wiring.rb +39 -0
  14. data/lib/ohai/mixin/command.rb +3 -54
  15. data/lib/ohai/mixin/constant_helper.rb +1 -1
  16. data/lib/ohai/mixin/dmi_decode.rb +1 -1
  17. data/lib/ohai/mixin/do_metadata.rb +1 -1
  18. data/lib/ohai/mixin/ec2_metadata.rb +1 -1
  19. data/lib/ohai/mixin/http_helper.rb +1 -1
  20. data/lib/ohai/mixin/network_helper.rb +1 -1
  21. data/lib/ohai/mixin/os.rb +1 -1
  22. data/lib/ohai/mixin/scaleway_metadata.rb +1 -1
  23. data/lib/ohai/mixin/seconds_to_human.rb +1 -1
  24. data/lib/ohai/mixin/shell_out.rb +50 -0
  25. data/lib/ohai/mixin/string.rb +1 -1
  26. data/lib/ohai/mixin/which.rb +38 -0
  27. data/lib/ohai/plugin_config.rb +1 -1
  28. data/lib/ohai/plugins/aix/kernel.rb +1 -1
  29. data/lib/ohai/plugins/aix/memory.rb +3 -3
  30. data/lib/ohai/plugins/aix/network.rb +1 -1
  31. data/lib/ohai/plugins/aix/platform.rb +1 -1
  32. data/lib/ohai/plugins/aix/uptime.rb +1 -1
  33. data/lib/ohai/plugins/aix/virtualization.rb +1 -1
  34. data/lib/ohai/plugins/azure.rb +1 -1
  35. data/lib/ohai/plugins/bsd/virtualization.rb +2 -2
  36. data/lib/ohai/plugins/cloud.rb +1 -1
  37. data/lib/ohai/plugins/command.rb +1 -1
  38. data/lib/ohai/plugins/cpu.rb +2 -2
  39. data/lib/ohai/plugins/darwin/memory.rb +1 -1
  40. data/lib/ohai/plugins/darwin/network.rb +1 -1
  41. data/lib/ohai/plugins/darwin/platform.rb +2 -2
  42. data/lib/ohai/plugins/darwin/virtualization.rb +1 -1
  43. data/lib/ohai/plugins/docker.rb +1 -1
  44. data/lib/ohai/plugins/ec2.rb +2 -2
  45. data/lib/ohai/plugins/erlang.rb +1 -1
  46. data/lib/ohai/plugins/eucalyptus.rb +1 -1
  47. data/lib/ohai/plugins/filesystem.rb +1 -1
  48. data/lib/ohai/plugins/fips.rb +1 -1
  49. data/lib/ohai/plugins/hostname.rb +1 -1
  50. data/lib/ohai/plugins/init_package.rb +1 -1
  51. data/lib/ohai/plugins/java.rb +1 -1
  52. data/lib/ohai/plugins/kernel.rb +2 -2
  53. data/lib/ohai/plugins/keys.rb +1 -1
  54. data/lib/ohai/plugins/languages.rb +1 -1
  55. data/lib/ohai/plugins/libvirt.rb +1 -1
  56. data/lib/ohai/plugins/linode.rb +1 -1
  57. data/lib/ohai/plugins/linux/block_device.rb +1 -1
  58. data/lib/ohai/plugins/linux/lsb.rb +1 -1
  59. data/lib/ohai/plugins/linux/memory.rb +1 -1
  60. data/lib/ohai/plugins/linux/network.rb +9 -9
  61. data/lib/ohai/plugins/linux/platform.rb +1 -1
  62. data/lib/ohai/plugins/linux/virtualization.rb +1 -1
  63. data/lib/ohai/plugins/network.rb +1 -1
  64. data/lib/ohai/plugins/ohai_time.rb +1 -1
  65. data/lib/ohai/plugins/openstack.rb +1 -1
  66. data/lib/ohai/plugins/os.rb +1 -1
  67. data/lib/ohai/plugins/packages.rb +20 -0
  68. data/lib/ohai/plugins/perl.rb +1 -1
  69. data/lib/ohai/plugins/platform.rb +1 -1
  70. data/lib/ohai/plugins/powershell.rb +1 -1
  71. data/lib/ohai/plugins/ps.rb +1 -1
  72. data/lib/ohai/plugins/python.rb +1 -1
  73. data/lib/ohai/plugins/shard.rb +1 -1
  74. data/lib/ohai/plugins/shells.rb +1 -1
  75. data/lib/ohai/plugins/softlayer.rb +1 -1
  76. data/lib/ohai/plugins/solaris2/network.rb +6 -8
  77. data/lib/ohai/plugins/solaris2/platform.rb +1 -1
  78. data/lib/ohai/plugins/solaris2/virtualization.rb +1 -1
  79. data/lib/ohai/plugins/ssh_host_key.rb +1 -1
  80. data/lib/ohai/plugins/uptime.rb +1 -1
  81. data/lib/ohai/plugins/virtualbox.rb +1 -1
  82. data/lib/ohai/plugins/vmware.rb +1 -1
  83. data/lib/ohai/plugins/windows/drivers.rb +1 -1
  84. data/lib/ohai/plugins/windows/network.rb +1 -1
  85. data/lib/ohai/plugins/windows/platform.rb +1 -1
  86. data/lib/ohai/plugins/windows/system_enclosure.rb +1 -1
  87. data/lib/ohai/plugins/windows/virtualization.rb +1 -1
  88. data/lib/ohai/plugins/zpools.rb +1 -1
  89. data/lib/ohai/provides_map.rb +1 -1
  90. data/lib/ohai/runner.rb +1 -1
  91. data/lib/ohai/system.rb +2 -3
  92. data/lib/ohai/util/file_helper.rb +4 -37
  93. data/lib/ohai/util/win32.rb +1 -1
  94. data/lib/ohai/version.rb +2 -2
  95. metadata +5 -2
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Joshua Timberman (<joshua@chef.io>)
3
- # Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
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) 2008-2016 Chef Software, Inc.
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,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright (c) 2014-2016 Chef Software, Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
3
  # Author:: Bryan McLellan (<btm@loftninjas.org>)
4
- # Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
4
+ # Copyright:: Copyright (c) Chef Software Inc.
5
5
  # Copyright:: Copyright (c) 2009 Bryan McLellan
6
6
  # License:: Apache License, Version 2.0
7
7
  #
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Thom May (<thom@clearairturbulence.org>)
3
- # Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
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");
@@ -52,7 +52,7 @@ Ohai.plugin(:ShardSeed) do
52
52
  def digest_algorithm
53
53
  case Ohai.config[:plugin][:shard_seed][:digest_algorithm] || default_digest_algorithm
54
54
  when "md5"
55
- require "digest/md5"
55
+ require "digest/md5" unless defined?(Digest::MD5)
56
56
  Digest::MD5
57
57
  when "sha256"
58
58
  require "openssl/digest"
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Tim Smith (<tsmith@chef.io>)
3
- # Copyright:: Copyright (c) 2016 Chef Software, Inc.
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");
@@ -39,7 +39,7 @@ Ohai.plugin(:Softlayer) do
39
39
  logger.trace("Plugin Softlayer: looks_like_softlayer? == true")
40
40
  metadata = fetch_metadata
41
41
  softlayer Mash.new
42
- metadata.each { |k, v| softlayer[k] = v } if metadata
42
+ metadata&.each { |k, v| softlayer[k] = v }
43
43
  else
44
44
  logger.trace("Plugin Softlayer: looks_like_softlayer? == false")
45
45
  end
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Benjamin Black (<nostromo@gmail.com>)
3
- # Copyright:: Copyright (c) 2008-2018, Chef Software Inc.
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");
@@ -86,7 +86,7 @@ Ohai.plugin(:Network) do
86
86
 
87
87
  def full_interface_name(iface, part_name, index)
88
88
  iface.each do |name, attrs|
89
- next unless attrs && attrs.respond_to?(:[])
89
+ next unless attrs.respond_to?(:[])
90
90
  return name if /^#{part_name}($|:)/.match(name) && attrs[:index] == index
91
91
  end
92
92
 
@@ -155,12 +155,10 @@ Ohai.plugin(:Network) do
155
155
  break
156
156
  end
157
157
  end
158
- if iface[ifn][:arp]
159
- iface[ifn][:arp].each_key do |addr|
160
- if addr.eql?(iaddr)
161
- iface[ifn][:addresses][iface[ifn][:arp][iaddr]] = { "family" => "lladdr" }
162
- break
163
- end
158
+ iface[ifn][:arp]&.each_key do |addr|
159
+ if addr.eql?(iaddr)
160
+ iface[ifn][:addresses][iface[ifn][:arp][iaddr]] = { "family" => "lladdr" }
161
+ break
164
162
  end
165
163
  end
166
164
  end
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Benjamin Black (<nostromo@gmail.com>)
3
- # Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
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,7 +1,7 @@
1
1
  #
2
2
  # Author:: Sean Walbran (<seanwalbran@gmail.com>)
3
3
  # Author:: Kurt Yoder (<ktyopscode@yoderhome.com>)
4
- # Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
4
+ # Copyright:: Copyright (c) Chef Software Inc.
5
5
  # Copyright:: Copyright (c) 2010 Kurt Yoder
6
6
  # License:: Apache License, Version 2.0
7
7
  #
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Bryan McLellan <btm@chef.io>
3
- # Copyright:: Copyright (c) 2012-2016 Chef Software, Inc.
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");
@@ -5,7 +5,7 @@
5
5
  # Author:: Doug MacEachern (<dougm@vmware.com>)
6
6
  # Author:: Kurt Yoder (<ktyopscode@yoderhome.com>)
7
7
  # Author:: Paul Mooring (<paul@chef.io>)
8
- # Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
8
+ # Copyright:: Copyright (c) Chef Software Inc.
9
9
  # Copyright:: Copyright (c) 2009 Bryan McLellan
10
10
  # Copyright:: Copyright (c) 2010 VMware, Inc.
11
11
  # License:: Apache License, Version 2.0
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: Tim Smith <tsmith@chef.io>
3
3
  # Author:: Joshua Colson <joshua.colson@gmail.com>
4
- # Copyright:: 2015-2019 Chef Software, Inc.
4
+ # Copyright:: Copyright (c) Chef Software Inc.
5
5
  # Copyright:: 2019 Joshua Colson
6
6
  # License:: Apache License, Version 2.0
7
7
  #
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: "Dan Robinson" <drobinson@chef.io>
3
3
  # Author:: "Christopher M. Luciano" <cmlucian@us.ibm.com>
4
- # Copyright:: Copyright (c) 2014-2016 Chef Software, Inc.
4
+ # Copyright:: Copyright (c) Chef Software Inc.
5
5
  # Copyright (C) 2015 IBM Corp.
6
6
  # License:: Apache License, Version 2.0
7
7
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright (c) 2015 Chef Software
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: James Gartrell (<jgartrel@gmail.com>)
3
- # Copyright:: Copyright (c) 2008-2017, Chef Software Inc.
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:: James Gartrell (<jgartrel@gmail.com>)
3
- # Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
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:: Stuart Preston (<stuart@chef.io>)
3
- # Copyright:: Copyright (c) 2018, Chef Software Inc.
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:: 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) 2015-2016 Chef Software, Inc.
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,6 +1,6 @@
1
1
  #
2
2
  # Author:: Jason J. W. Williams (williamsjj@digitar.com)
3
- # Copyright:: Copyright (c) 2011-2017 Chef Software, Inc.
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,7 +1,7 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
3
  # Author:: Daniel DeLeo (<dan@chef.io>)
4
- # Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
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,6 +1,6 @@
1
1
  #
2
2
  # Author:: Claire McQuin (<claire@chef.io>)
3
- # Copyright:: Copyright (c) 2013-2019, Chef Software Inc.
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"); you
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
- # Copyright:: Copyright (c) 2008-2019, Chef Software Inc.
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");
@@ -22,13 +22,12 @@ require_relative "log"
22
22
  require_relative "mash"
23
23
  require_relative "runner"
24
24
  require_relative "dsl"
25
- require_relative "mixin/command"
25
+ require_relative "mixin/shell_out"
26
26
  require_relative "mixin/os"
27
27
  require_relative "mixin/string"
28
28
  require_relative "mixin/constant_helper"
29
29
  require_relative "provides_map"
30
30
  require_relative "hints"
31
- require "mixlib/shellout" unless defined?(Mixlib::ShellOut::DEFAULT_READ_TIMEOUT)
32
31
  require_relative "config"
33
32
  require "ffi_yajl" unless defined?(FFI_Yajl)
34
33
 
@@ -1,38 +1,5 @@
1
- # Author:: Lamont Granquist (<lamont@chef.io>)
2
- #
3
- # Copyright:: Copyright (c) 2013-14 Chef Software, Inc.
4
- #
5
- # License:: Apache License, Version 2.0
6
- #
7
- # Licensed under the Apache License, Version 2.0 (the "License");
8
- # you may not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing, software
14
- # distributed under the License is distributed on an "AS IS" BASIS,
15
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- # See the License for the specific language governing permissions and
17
- # limitations under the License.
18
-
19
- # Copied from chef/lib/chef/util/selinux.rb
20
-
21
- module Ohai
22
- module Util
23
- module FileHelper
24
- def which(cmd)
25
- paths = ENV["PATH"].split(File::PATH_SEPARATOR) + [ "/bin", "/usr/bin", "/sbin", "/usr/sbin" ]
26
- paths.each do |path|
27
- filename = File.join(path, cmd)
28
- if File.executable?(filename)
29
- logger.trace("Plugin #{name}: found #{cmd} at #{filename}")
30
- return filename
31
- end
32
- end
33
- logger.trace("Plugin #{name}: did not find #{cmd}")
34
- false
35
- end
36
- end
37
- end
1
+ $stderr.puts "WARN: Ohai::Util::FileHelper is deprecated, please use Ohai::Mixin::Which or remove if the reference is unnecessary"
2
+ require_relative "../mixin/which"
3
+ module Ohai::Util
4
+ FileHelper = Ohai::Mixin::Which
38
5
  end
@@ -1,6 +1,6 @@
1
1
  # Author:: Adam Edwards (<adamed@chef.io>)
2
2
  #
3
- # Copyright:: Copyright (c) 2013-14 Chef Software, Inc.
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
4
  #
5
5
  # License:: Apache License, Version 2.0
6
6
  #
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
- # Copyright:: Copyright (c) 2008-2018, Chef Software Inc.
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");
@@ -18,5 +18,5 @@
18
18
 
19
19
  module Ohai
20
20
  OHAI_ROOT = File.expand_path(File.dirname(__FILE__))
21
- VERSION = "16.4.12".freeze
21
+ VERSION = "16.5.0".freeze
22
22
  end
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: 16.4.12
4
+ version: 16.5.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-08-19 00:00:00.000000000 Z
11
+ date: 2020-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi-yajl
@@ -217,6 +217,7 @@ files:
217
217
  - lib/ohai/log.rb
218
218
  - lib/ohai/mash.rb
219
219
  - lib/ohai/mixin/azure_metadata.rb
220
+ - lib/ohai/mixin/chef_utils_wiring.rb
220
221
  - lib/ohai/mixin/command.rb
221
222
  - lib/ohai/mixin/constant_helper.rb
222
223
  - lib/ohai/mixin/dmi_decode.rb
@@ -228,8 +229,10 @@ files:
228
229
  - lib/ohai/mixin/os.rb
229
230
  - lib/ohai/mixin/scaleway_metadata.rb
230
231
  - lib/ohai/mixin/seconds_to_human.rb
232
+ - lib/ohai/mixin/shell_out.rb
231
233
  - lib/ohai/mixin/softlayer_metadata.rb
232
234
  - lib/ohai/mixin/string.rb
235
+ - lib/ohai/mixin/which.rb
233
236
  - lib/ohai/plugin_config.rb
234
237
  - lib/ohai/plugins/aix/kernel.rb
235
238
  - lib/ohai/plugins/aix/memory.rb