ohai 16.2.1 → 16.4.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -1
  3. data/bin/ohai +0 -2
  4. data/lib/ohai/application.rb +2 -2
  5. data/lib/ohai/dsl/plugin.rb +1 -1
  6. data/lib/ohai/loader.rb +1 -2
  7. data/lib/ohai/log.rb +1 -1
  8. data/lib/ohai/mixin/command.rb +1 -1
  9. data/lib/ohai/mixin/dmi_decode.rb +2 -2
  10. data/lib/ohai/mixin/os.rb +1 -1
  11. data/lib/ohai/mixin/softlayer_metadata.rb +1 -1
  12. data/lib/ohai/plugins/aix/memory.rb +3 -3
  13. data/lib/ohai/plugins/aix/network.rb +2 -1
  14. data/lib/ohai/plugins/aix/uptime.rb +2 -2
  15. data/lib/ohai/plugins/aix/virtualization.rb +5 -5
  16. data/lib/ohai/plugins/azure.rb +1 -1
  17. data/lib/ohai/plugins/bsd/virtualization.rb +2 -2
  18. data/lib/ohai/plugins/c.rb +2 -2
  19. data/lib/ohai/plugins/cloud.rb +1 -1
  20. data/lib/ohai/plugins/cpu.rb +2 -2
  21. data/lib/ohai/plugins/darwin/network.rb +3 -3
  22. data/lib/ohai/plugins/darwin/virtualization.rb +1 -1
  23. data/lib/ohai/plugins/docker.rb +2 -2
  24. data/lib/ohai/plugins/dragonflybsd/platform.rb +2 -4
  25. data/lib/ohai/plugins/ec2.rb +8 -7
  26. data/lib/ohai/plugins/eucalyptus.rb +1 -1
  27. data/lib/ohai/plugins/filesystem.rb +11 -17
  28. data/lib/ohai/plugins/fips.rb +1 -5
  29. data/lib/ohai/plugins/freebsd/platform.rb +2 -4
  30. data/lib/ohai/plugins/gce.rb +3 -3
  31. data/lib/ohai/plugins/hostname.rb +16 -16
  32. data/lib/ohai/plugins/kernel.rb +1 -1
  33. data/lib/ohai/plugins/linux/hostnamectl.rb +1 -2
  34. data/lib/ohai/plugins/linux/interrupts.rb +1 -1
  35. data/lib/ohai/plugins/linux/lsb.rb +1 -2
  36. data/lib/ohai/plugins/linux/lspci.rb +1 -2
  37. data/lib/ohai/plugins/linux/machineid.rb +2 -2
  38. data/lib/ohai/plugins/linux/mdadm.rb +1 -1
  39. data/lib/ohai/plugins/linux/network.rb +19 -9
  40. data/lib/ohai/plugins/linux/platform.rb +22 -25
  41. data/lib/ohai/plugins/linux/virtualization.rb +12 -9
  42. data/lib/ohai/plugins/netbsd/network.rb +4 -8
  43. data/lib/ohai/plugins/netbsd/platform.rb +2 -4
  44. data/lib/ohai/plugins/network.rb +5 -4
  45. data/lib/ohai/plugins/openbsd/network.rb +4 -8
  46. data/lib/ohai/plugins/openbsd/platform.rb +2 -4
  47. data/lib/ohai/plugins/openstack.rb +3 -2
  48. data/lib/ohai/plugins/packages.rb +1 -1
  49. data/lib/ohai/plugins/passwd.rb +2 -1
  50. data/lib/ohai/plugins/rackspace.rb +5 -4
  51. data/lib/ohai/plugins/root_group.rb +1 -1
  52. data/lib/ohai/plugins/ruby.rb +4 -15
  53. data/lib/ohai/plugins/scaleway.rb +1 -1
  54. data/lib/ohai/plugins/shard.rb +1 -1
  55. data/lib/ohai/plugins/solaris2/dmi.rb +2 -3
  56. data/lib/ohai/plugins/solaris2/memory.rb +1 -2
  57. data/lib/ohai/plugins/solaris2/network.rb +2 -6
  58. data/lib/ohai/plugins/solaris2/platform.rb +1 -2
  59. data/lib/ohai/plugins/solaris2/virtualization.rb +3 -6
  60. data/lib/ohai/plugins/ssh_host_key.rb +1 -1
  61. data/lib/ohai/plugins/uptime.rb +1 -1
  62. data/lib/ohai/plugins/vmware.rb +2 -2
  63. data/lib/ohai/plugins/windows/dmi.rb +2 -2
  64. data/lib/ohai/plugins/windows/drivers.rb +1 -1
  65. data/lib/ohai/plugins/windows/memory.rb +1 -1
  66. data/lib/ohai/plugins/windows/network.rb +4 -4
  67. data/lib/ohai/plugins/windows/platform.rb +1 -1
  68. data/lib/ohai/plugins/windows/virtualization.rb +1 -1
  69. data/lib/ohai/provides_map.rb +2 -2
  70. data/lib/ohai/runner.rb +1 -1
  71. data/lib/ohai/util/ip_helper.rb +2 -2
  72. data/lib/ohai/util/win32.rb +1 -1
  73. data/lib/ohai/version.rb +1 -1
  74. data/ohai.gemspec +0 -1
  75. metadata +2 -16
@@ -45,8 +45,8 @@ Ohai.plugin(:DMI) do
45
45
  ].freeze
46
46
 
47
47
  collect_data(:windows) do
48
- require "ohai/common/dmi"
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
@@ -22,7 +22,7 @@ Ohai.plugin(:Drivers) do
22
22
  collect_data(:windows) do
23
23
  if configuration(:enabled)
24
24
 
25
- require "wmi-lite/wmi"
25
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
26
26
 
27
27
  kext = Mash.new
28
28
  pnp_drivers = Mash.new
@@ -17,7 +17,7 @@ Ohai.plugin(:Memory) do
17
17
  provides "memory"
18
18
 
19
19
  collect_data(:windows) do
20
- require "wmi-lite/wmi"
20
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
21
21
 
22
22
  memory Mash.new
23
23
  memory[:swap] = 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 prefered as default_route
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>}]
@@ -117,8 +117,8 @@ Ohai.plugin(:Network) do
117
117
  end
118
118
 
119
119
  collect_data(:windows) do
120
-
121
- require "wmi-lite/wmi"
120
+ require "ipaddress" unless defined?(IPAddress)
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 ip =~ /^fe80/i
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 concensus
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
@@ -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 attribute =~ %r{//+}
140
- raise Ohai::Exceptions::AttributeSyntaxError, "Attribute contains a trailing '/': #{attribute}" if attribute =~ %r{/$}
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 '/'
@@ -18,7 +18,7 @@
18
18
  #
19
19
 
20
20
  require_relative "dsl"
21
- require "benchmark"
21
+ require "benchmark" unless defined?(Benchmark)
22
22
 
23
23
  module Ohai
24
24
  class Runner
@@ -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")
@@ -19,7 +19,7 @@
19
19
  module Ohai
20
20
  module Util
21
21
  module Win32
22
- if RUBY_PLATFORM =~ /mswin|mingw|windows/
22
+ if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
23
23
 
24
24
  require "ffi" unless defined?(FFI)
25
25
 
@@ -18,5 +18,5 @@
18
18
 
19
19
  module Ohai
20
20
  OHAI_ROOT = File.expand_path(File.dirname(__FILE__))
21
- VERSION = "16.2.1".freeze
21
+ VERSION = "16.4.12".freeze
22
22
  end
@@ -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.2.1
4
+ version: 16.4.12
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-06-23 00:00:00.000000000 Z
11
+ date: 2020-08-19 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