ohai 17.9.4 → 18.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1f1c149d4e95abb73e9d2ec15f6318c5b6b588ff2369b68ca1b8a3d26cd69826
4
- data.tar.gz: 52dd3e1df41fd3709051a85fe5cba9775ebc739998de03079f9afc8dee9fa652
3
+ metadata.gz: e3f13e229791bcb56c90dfc30f3fa5fea108b9d185c1c0492a5198c2e6bae93b
4
+ data.tar.gz: 60134dedd0d7da72c1932dc987b143303d9f832bf123380ab22db9462e6799b2
5
5
  SHA512:
6
- metadata.gz: f6aa99445c427e776d6ce7eed4077a9f887997b5fe2a3f17f2c9cc4f19bf6fe542afc5e48b780c6b552f9a777040d751ac571d0f3751b0932c574ac86c844831
7
- data.tar.gz: 1b43dc4b727518ec92627e4833897aec7f05f2000f11bdb4595fd6a06e0fe9cca3a25c7b41bc6914988fd1e29f7bc26f101e98703b385e82a341fd02c02424aa
6
+ metadata.gz: 735fb50fdd3ee96a1325eaae9847d0f998b72b50116963d829bd7b350d5b6af4e76089083612c7a66f7ec7e80a374e45b25b711b38e6ff5c0435f9ac66ae39ec
7
+ data.tar.gz: ed81c806e9d91688e5c7aa5a4246aea55e62a8dbca35e3c89698795c29f45083572bafdf62382abcce201c53b736a1f11b2fcd17e4ff5aa61a114707fc2f1b11
data/Gemfile CHANGED
@@ -3,20 +3,20 @@ source "https://rubygems.org"
3
3
 
4
4
  gemspec
5
5
 
6
- # pull these gems from chef-17 of chef/chef so that we're testing against what we will release
7
- gem "chef-config", git: "https://github.com/chef/chef", branch: "chef-17", glob: "chef-config/chef-config.gemspec"
8
- gem "chef-utils", git: "https://github.com/chef/chef", branch: "chef-17", glob: "chef-utils/chef-utils.gemspec"
6
+ # pull these gems from main of chef/chef so that we're testing against what we will release
7
+ gem "chef-config", git: "https://github.com/chef/chef", branch: "main", glob: "chef-config/chef-config.gemspec"
8
+ gem "chef-utils", git: "https://github.com/chef/chef", branch: "main", glob: "chef-utils/chef-utils.gemspec"
9
9
 
10
10
  # NOTE: do not submit PRs to add pry as a dep, add to your Gemfile.local
11
11
  group :development do
12
- gem "chefstyle", "2.1.3"
12
+ gem "chefstyle", "2.2.2"
13
13
  gem "ipaddr_extensions"
14
14
  gem "rake", ">= 10.1.0"
15
15
  gem "rspec-collection_matchers", "~> 1.0"
16
16
  gem "rspec-core", "~> 3.0"
17
17
  gem "rspec-expectations", "~> 3.0"
18
18
  gem "rspec-mocks", "~> 3.0"
19
- gem "rubocop-performance", "1.12.0"
19
+ gem "rubocop-performance", "1.13.3"
20
20
  gem "rubocop-rspec"
21
21
  end
22
22
 
@@ -25,59 +25,57 @@ module Ohai
25
25
  # all-lowercase, all non-alphanumeric converted to '_'
26
26
  # 128-255 are 'oem_data_[id]'
27
27
  # Everything else is 'unknown'
28
- unless defined?(ID_TO_DESCRIPTION)
29
- ID_TO_DESCRIPTION = {
30
- 0 => "bios",
31
- 1 => "system",
32
- 2 => "base_board",
33
- 3 => "chassis",
34
- 4 => "processor",
35
- 5 => "memory_controller",
36
- 6 => "memory_module",
37
- 7 => "cache",
38
- 8 => "port_connector",
39
- 9 => "system_slots",
40
- 10 => "on_board_devices",
41
- 11 => "oem_strings",
42
- 12 => "system_configuration_options",
43
- 13 => "bios_language",
44
- 14 => "group_associations",
45
- 15 => "system_event_log",
46
- 16 => "physical_memory_array",
47
- 17 => "memory_device",
48
- 18 => "32_bit_memory_error",
49
- 19 => "memory_array_mapped_address",
50
- 20 => "memory_device_mapped_address",
51
- 21 => "built_in_pointing_device",
52
- 22 => "portable_battery",
53
- 23 => "system_reset",
54
- 24 => "hardware_security",
55
- 25 => "system_power_controls",
56
- 26 => "voltage_probe",
57
- 27 => "cooling_device",
58
- 28 => "temperature_probe",
59
- 29 => "electrical_current_probe",
60
- 30 => "out_of_band_remote_access",
61
- 31 => "boot_integrity_services",
62
- 32 => "system_boot",
63
- 33 => "64_bit_memory_error",
64
- 34 => "management_device",
65
- 35 => "management_device_component",
66
- 36 => "management_device_threshold_data",
67
- 37 => "memory_channel",
68
- 38 => "ipmi_device",
69
- 39 => "power_supply",
70
- 40 => "additional_information",
71
- 41 => "onboard_devices_extended_information",
72
- 42 => "management_controller_host_interfaces",
73
- 126 => "disabled_entries",
74
- 127 => "end_of_table_marker",
75
- }.freeze
76
- end
28
+ ID_TO_DESCRIPTION = {
29
+ 0 => "bios",
30
+ 1 => "system",
31
+ 2 => "base_board",
32
+ 3 => "chassis",
33
+ 4 => "processor",
34
+ 5 => "memory_controller",
35
+ 6 => "memory_module",
36
+ 7 => "cache",
37
+ 8 => "port_connector",
38
+ 9 => "system_slots",
39
+ 10 => "on_board_devices",
40
+ 11 => "oem_strings",
41
+ 12 => "system_configuration_options",
42
+ 13 => "bios_language",
43
+ 14 => "group_associations",
44
+ 15 => "system_event_log",
45
+ 16 => "physical_memory_array",
46
+ 17 => "memory_device",
47
+ 18 => "32_bit_memory_error",
48
+ 19 => "memory_array_mapped_address",
49
+ 20 => "memory_device_mapped_address",
50
+ 21 => "built_in_pointing_device",
51
+ 22 => "portable_battery",
52
+ 23 => "system_reset",
53
+ 24 => "hardware_security",
54
+ 25 => "system_power_controls",
55
+ 26 => "voltage_probe",
56
+ 27 => "cooling_device",
57
+ 28 => "temperature_probe",
58
+ 29 => "electrical_current_probe",
59
+ 30 => "out_of_band_remote_access",
60
+ 31 => "boot_integrity_services",
61
+ 32 => "system_boot",
62
+ 33 => "64_bit_memory_error",
63
+ 34 => "management_device",
64
+ 35 => "management_device_component",
65
+ 36 => "management_device_threshold_data",
66
+ 37 => "memory_channel",
67
+ 38 => "ipmi_device",
68
+ 39 => "power_supply",
69
+ 40 => "additional_information",
70
+ 41 => "onboard_devices_extended_information",
71
+ 42 => "management_controller_host_interfaces",
72
+ 126 => "disabled_entries",
73
+ 127 => "end_of_table_marker",
74
+ }.freeze
77
75
 
78
76
  # list of IDs to collect from config or default to a sane list that prunes
79
77
  # away some of the less useful IDs
80
- ID_TO_CAPTURE = [ 0, 1, 2, 3, 4, 6, 11 ].freeze unless defined?(ID_TO_CAPTURE)
78
+ ID_TO_CAPTURE = [ 0, 1, 2, 3, 4, 6, 11 ].freeze
81
79
 
82
80
  # the allowlisted DMI IDs. This is combination of the defaults + any additional
83
81
  # IDs defined in the :additional_dmi_ids config
@@ -118,16 +116,14 @@ module Ohai
118
116
  id
119
117
  end
120
118
 
121
- unless defined?(SKIPPED_CONVENIENCE_KEYS)
122
- SKIPPED_CONVENIENCE_KEYS = %w{
123
- application_identifier
124
- caption
125
- creation_class_name
126
- size
127
- system_creation_class_name
128
- record_id
129
- }.freeze
130
- end
119
+ SKIPPED_CONVENIENCE_KEYS = %w{
120
+ application_identifier
121
+ caption
122
+ creation_class_name
123
+ size
124
+ system_creation_class_name
125
+ record_id
126
+ }.freeze
131
127
 
132
128
  # create simplified convenience access keys for each record type
133
129
  # for single occurrences of one type, copy to top level all fields and values
@@ -38,27 +38,22 @@ module Ohai
38
38
  conn.get("/2016-01-01/#{uri}", { "User-Agent" => "chef-ohai/#{Ohai::VERSION}" })
39
39
  end
40
40
 
41
- def fetch_metadata(id = "", is_directory = true)
41
+ def fetch_metadata(id = "")
42
42
  response = http_get(id)
43
43
  return nil unless response.code == "200"
44
44
 
45
- if !is_directory
46
- if json?(response.body)
47
- data = String(response.body)
48
- parser = FFI_Yajl::Parser.new
49
- parser.parse(data)
50
- else
51
- response.body
52
- end
53
- elsif is_directory
45
+ if json?(response.body)
46
+ data = String(response.body)
47
+ parser = FFI_Yajl::Parser.new
48
+ parser.parse(data)
49
+ elsif response.body.include?("\n")
54
50
  temp = {}
55
51
  response.body.split("\n").each do |sub_attr|
56
- if "#{id}/#{sub_attr}" != "/user-data"
57
- uri = id == "" ? "#{id}#{sub_attr}/" : "#{id}#{sub_attr}"
58
- temp[sanitize_key(sub_attr).gsub(/_$/, "")] = fetch_metadata(uri, has_trailing_slash?(uri))
59
- end
52
+ temp[sanitize_key(sub_attr)] = fetch_metadata("#{id}/#{sub_attr}")
60
53
  end
61
54
  temp
55
+ else
56
+ response.body
62
57
  end
63
58
  end
64
59
 
@@ -80,7 +75,7 @@ module Ohai
80
75
  #
81
76
  # @return [Boolean] is there a trailing /?
82
77
  def has_trailing_slash?(data)
83
- !!(data =~ %r{/$})
78
+ !!( data =~ %r{/$} )
84
79
  end
85
80
 
86
81
  def sanitize_key(key)
@@ -35,9 +35,10 @@ module Ohai
35
35
  AZURE_METADATA_ADDR ||= "169.254.169.254"
36
36
 
37
37
  # it's important that the newer versions are at the end of this array so we can skip sorting it
38
- AZURE_SUPPORTED_VERSIONS ||= %w{ 2017-04-02 2017-08-01 2017-12-01 2018-02-01 2018-04-02
39
- 2018-10-01 2019-02-01 2019-03-11 2019-04-30 2019-06-01
40
- 2019-06-04 2019-08-01 2019-08-15 2019-11-01 }.freeze
38
+ AZURE_SUPPORTED_VERSIONS ||= %w{ 2018-10-01 2019-02-01 2019-03-11 2019-04-30 2019-06-01
39
+ 2019-06-04 2019-08-01 2019-08-15 2019-11-01 2020-06-01
40
+ 2020-07-15 2020-09-01 2020-10-01 2020-12-01 2021-01-01
41
+ 2021-02-01 2021-03-01 2021-05-01 2021-10-01 }.freeze
41
42
 
42
43
  def best_api_version
43
44
  @api_version ||= begin
@@ -23,12 +23,10 @@ require "socket" unless defined?(Socket)
23
23
  module Ohai
24
24
  module Mixin
25
25
  module NetworkHelper
26
- unless defined?(FAMILIES)
27
- FAMILIES = {
28
- "inet" => "default",
29
- "inet6" => "default_inet6",
30
- }.freeze
31
- end
26
+ FAMILIES = {
27
+ "inet" => "default",
28
+ "inet6" => "default_inet6",
29
+ }.freeze
32
30
 
33
31
  def hex_to_dec_netmask(netmask)
34
32
  # example 'ffff0000' -> '255.255.0.0'
data/lib/ohai/mixin/os.rb CHANGED
@@ -110,7 +110,7 @@ module Ohai
110
110
  "dragonflybsd"
111
111
  when /solaris2/
112
112
  "solaris2"
113
- when /mswin|mingw32|windows/
113
+ when /mswin|mingw|windows/
114
114
  # After long discussion in IRC the "powers that be" have come to a consensus
115
115
  # that no Windows platform exists that was not based on the
116
116
  # Windows_NT kernel, so we herby decree that "windows" will refer to all
@@ -73,9 +73,11 @@ Ohai.plugin(:Azure) do
73
73
  end
74
74
 
75
75
  def tcp_ip_dhcp_domain
76
- return unless RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
76
+ return unless RUBY_PLATFORM.match?(/mswin|mingw|windows/)
77
77
 
78
- require "win32/registry" unless defined?(Win32::Registry)
78
+ if ChefUtils.windows?
79
+ require "win32/registry" unless defined?(Win32::Registry)
80
+ end
79
81
 
80
82
  begin
81
83
  key = Win32::Registry::HKEY_LOCAL_MACHINE.open("SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters")
@@ -81,7 +81,7 @@ Ohai.plugin(:EC2) do
81
81
  # linux hosts
82
82
  # @return [Boolean] do we have a Xen Identifying Number or not?
83
83
  def has_ec2_identifying_number?
84
- if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
84
+ if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
85
85
  require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
86
86
  wmi = WmiLite::Wmi.new
87
87
  if /^ec2/.match?(wmi.first_of("Win32_ComputerSystemProduct")["identifyingnumber"])
@@ -142,8 +142,8 @@ Ohai.plugin(:EC2) do
142
142
  ec2[:account_id] = fetch_dynamic_data["accountId"]
143
143
  ec2[:availability_zone] = fetch_dynamic_data["availabilityZone"]
144
144
  ec2[:region] = fetch_dynamic_data["region"]
145
- # ASCII-8BIT is equivalent to BINARY in this case
146
- if ec2[:userdata] && ec2[:userdata].encoding.to_s == "ASCII-8BIT"
145
+
146
+ if ec2[:userdata] && ec2[:userdata].encoding == Encoding::BINARY
147
147
  logger.trace("Plugin EC2: Binary UserData Found. Storing in base64")
148
148
  ec2[:userdata] = Base64.encode64(ec2[:userdata])
149
149
  end
@@ -271,6 +271,30 @@ Ohai.plugin(:Filesystem) do
271
271
  fs
272
272
  end
273
273
 
274
+ def collect_btrfs_data(entry)
275
+ btrfs = Mash.new
276
+ if entry[:fs_type] == "btrfs" && entry["uuid"]
277
+ uuid = entry["uuid"]
278
+ alloc = "/sys/fs/btrfs/#{uuid}/allocation"
279
+ %w{data metadata system}.each do |bg_type|
280
+ dir = "#{alloc}/#{bg_type}"
281
+ %w{single dup}.each do |raid|
282
+ if file_exist?("#{dir}/#{raid}")
283
+ btrfs["raid"] = raid
284
+ end
285
+ end
286
+ logger.trace("Plugin Filesystem: reading btrfs allocation files at #{dir}")
287
+ btrfs["allocation"] ||= Mash.new
288
+ btrfs["allocation"][bg_type] ||= Mash.new
289
+ %w{total_bytes bytes_used}.each do |field|
290
+ bytes = file_read("#{dir}/#{field}").chomp.to_i
291
+ btrfs["allocation"][bg_type][field] = "#{bytes}"
292
+ end
293
+ end
294
+ end
295
+ btrfs
296
+ end
297
+
274
298
  collect_data(:linux) do
275
299
  fs = Mash.new
276
300
 
@@ -394,6 +418,12 @@ Ohai.plugin(:Filesystem) do
394
418
  end
395
419
  end
396
420
 
421
+ fs.each do |key, entry|
422
+ if entry[:fs_type] == "btrfs"
423
+ fs[key][:btrfs] = collect_btrfs_data(entry)
424
+ end
425
+ end
426
+
397
427
  by_pair = fs
398
428
  by_device = generate_device_view(fs)
399
429
  by_mountpoint = generate_mountpoint_view(fs)
@@ -49,7 +49,7 @@ Ohai.plugin(:GCE) do
49
49
  # looks at the Manufacturer and Model WMI values to see if they starts with Google.
50
50
  # @return [Boolean] Are the manufacturer and model Google?
51
51
  def has_gce_system_info?
52
- if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
52
+ if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
53
53
  require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
54
54
  wmi = WmiLite::Wmi.new
55
55
  computer_system = wmi.first_of("Win32_ComputerSystem")
@@ -35,6 +35,8 @@ Ohai.plugin(:Mdadm) do
35
35
  device_mash[:size] = Regexp.last_match[1].to_f
36
36
  when /State\s+: ([a-z]+)/
37
37
  device_mash[:state] = Regexp.last_match[1]
38
+ when /UUID\s+: ([0-9a-z:]+)/
39
+ device_mash[:UUID] = Regexp.last_match[1]
38
40
  when /Total Devices\s+: ([0-9]+)/
39
41
  device_mash[:device_counts][:total] = Regexp.last_match[1].to_i
40
42
  when /Raid Devices\s+: ([0-9]+)/
@@ -80,9 +80,22 @@ Ohai.plugin(:Network) do
80
80
  line.strip!
81
81
  logger.trace("Plugin Network: Parsing #{line}")
82
82
  if /\\/.match?(line)
83
+ # If we have multipath routing, then the first part will be a normal
84
+ # looking route:
85
+ # default proto ra metric 1024 <other options>
86
+ # Each successive part after that is a hop without those options.
87
+ # So the first thing we do is grab that first part, and split it into
88
+ # the route destination ("default"), and the route options.
83
89
  parts = line.split("\\")
84
- route_dest = parts.shift.strip
85
- route_endings = parts
90
+ route_dest, dest_opts = parts.first.split(nil, 2)
91
+ # Then all the route endings, generally just nexthops.
92
+ route_endings = parts[1..]
93
+ if dest_opts && !dest_opts.empty?
94
+ # Route options like proto, metric, etc. only appear once for each
95
+ # multipath configuration. Prepend this information to the route
96
+ # endings so the code below will assign the fields properly.
97
+ route_endings.map! { |e| e.include?("nexthop") ? "#{dest_opts} #{e}" : e }
98
+ end
86
99
  elsif line =~ /^([^\s]+)\s(.*)$/
87
100
  route_dest = $1
88
101
  route_endings = [$2]
@@ -90,9 +103,24 @@ Ohai.plugin(:Network) do
90
103
  next
91
104
  end
92
105
  route_endings.each do |route_ending|
106
+ route_entry = Mash.new(destination: route_dest,
107
+ family: family[:name])
108
+ route_int = nil
93
109
  if route_ending =~ /\bdev\s+([^\s]+)\b/
94
110
  route_int = $1
95
- else
111
+ end
112
+ # does any known interface own the src address?
113
+ # we try to infer the interface/device from its address if it isn't specified
114
+ # we want to override the interface set via nexthop but only if possible
115
+ if line =~ /\bsrc\s+([^\s]+)\b/ && (!route_int || line.include?("nexthop"))
116
+ # only clobber previously set route_int if we find a match
117
+ if (match = iface.select { |name, intf| intf.fetch("addresses", {}).any? { |addr, _| addr == $1 } }.keys.first)
118
+ route_int = match
119
+ route_entry[:inferred] = true
120
+ end
121
+ end
122
+
123
+ unless route_int
96
124
  logger.trace("Plugin Network: Skipping route entry without a device: '#{line}'")
97
125
  next
98
126
  end
@@ -103,8 +131,6 @@ Ohai.plugin(:Network) do
103
131
  next
104
132
  end
105
133
 
106
- route_entry = Mash.new(destination: route_dest,
107
- family: family[:name])
108
134
  %w{via scope metric proto src}.each do |k|
109
135
  # http://rubular.com/r/pwTNp65VFf
110
136
  route_entry[k] = $1 if route_ending =~ /\b#{k}\s+([^\s]+)/
@@ -350,6 +376,7 @@ Ohai.plugin(:Network) do
350
376
  so = shell_out("ip -d -s link")
351
377
  tmp_int = nil
352
378
  on_rx = true
379
+ xdp_mode = nil
353
380
  so.stdout.lines do |line|
354
381
  if line =~ IPROUTE_INT_REGEX
355
382
  tmp_int = $2
@@ -425,6 +452,30 @@ Ohai.plugin(:Network) do
425
452
  if line =~ /\sstate (\w+)/
426
453
  iface[tmp_int]["state"] = $1.downcase
427
454
  end
455
+
456
+ if line.include?("xdp")
457
+ mode = line.scan(/\s(xdp|xdpgeneric|xdpoffload|xdpmulti)\s/).flatten[0]
458
+ # Fetches and sets the mode from the first line.
459
+ unless mode.nil?
460
+ iface[tmp_int][:xdp] = {}
461
+ if mode.eql?("xdp")
462
+ # In case of xdpdrv, mode is xdp,
463
+ # to keep it consistent, keeping mode as xdpdrv.
464
+ mode = "xdpdrv"
465
+ end
466
+ xdp_mode = mode
467
+ iface[tmp_int][:xdp][:attached] = []
468
+ end
469
+
470
+ if line =~ %r{prog/(\w+) id (\d+) tag (\w+)}
471
+ mode = $1.eql?("xdp") ? xdp_mode : $1
472
+ iface[tmp_int][:xdp][:attached] << {
473
+ mode: mode,
474
+ id: $2,
475
+ tag: $3,
476
+ }
477
+ end
478
+ end
428
479
  end
429
480
  iface
430
481
  end
@@ -607,10 +658,12 @@ Ohai.plugin(:Network) do
607
658
  # sorting the selected routes:
608
659
  # - getting default routes first
609
660
  # - then sort by metric
661
+ # - then sort by if the device was inferred or not (preferring explicit to inferred)
610
662
  # - then by prefixlen
611
663
  [
612
664
  r[:destination] == "default" ? 0 : 1,
613
665
  r[:metric].nil? ? 0 : r[:metric].to_i,
666
+ r[:inferred] ? 1 : 0,
614
667
  # for some reason IPAddress doesn't accept "::/0", it doesn't like prefix==0
615
668
  # just a quick workaround: use 0 if IPAddress fails
616
669
  begin
@@ -49,7 +49,7 @@ Ohai.plugin(:Openstack) do
49
49
  # https://help.dreamhost.com/hc/en-us/articles/228377408-How-to-find-the-default-user-of-an-image
50
50
  def openstack_provider
51
51
  # dream host doesn't support windows so bail early if we're on windows
52
- return "openstack" if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
52
+ return "openstack" if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
53
53
 
54
54
  if Etc::Passwd.entries.map(&:name).include?("dhc-user")
55
55
  "dreamhost"
@@ -48,7 +48,7 @@ Ohai.plugin(:Rackspace) do
48
48
  # true:: If the rackspace cloud can be identified
49
49
  # false:: Otherwise
50
50
  def has_rackspace_manufacturer?
51
- return false unless RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
51
+ return false unless RUBY_PLATFORM.match?(/mswin|mingw|windows/)
52
52
 
53
53
  require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
54
54
  wmi = WmiLite::Wmi.new
@@ -22,18 +22,16 @@ Ohai.plugin(:Rpm) do
22
22
  provides "rpm"
23
23
  optional "true"
24
24
 
25
- MACROS_MARKER = /========================/.freeze unless defined?(MACROS_MARKER)
25
+ MACROS_MARKER = /========================/.freeze
26
26
 
27
- unless defined?(DO_NOT_SPLIT)
28
- DO_NOT_SPLIT = %w{
29
- build_arch
30
- build_os
31
- install_arch
32
- install_os
33
- archcolor
34
- optflags
35
- }.freeze
36
- end
27
+ DO_NOT_SPLIT = %w{
28
+ build_arch
29
+ build_os
30
+ install_arch
31
+ install_os
32
+ archcolor
33
+ optflags
34
+ }.freeze
37
35
 
38
36
  collect_data(:aix, :darwin, :dragonflybsd, :freebsd, :linux, :netbsd, :openbsd, :solaris2) do
39
37
  rpm_path = which("rpm")
@@ -21,8 +21,8 @@ module Ohai
21
21
  require "ipaddress" unless defined?(IPAddress)
22
22
 
23
23
  # Corresponding to RFC 4192 + RFC 4193
24
- IPV6_LINK_LOCAL_UNICAST_BLOCK = IPAddress("fe80::/10") unless defined?(IPV6_LINK_LOCAL_UNICAST_BLOCK)
25
- IPV6_PRIVATE_ADDRESS_BLOCK = IPAddress("fc00::/7") unless defined?(IPV6_PRIVATE_ADDRESS_BLOCK)
24
+ IPV6_LINK_LOCAL_UNICAST_BLOCK = IPAddress("fe80::/10")
25
+ IPV6_PRIVATE_ADDRESS_BLOCK = IPAddress("fc00::/7")
26
26
 
27
27
  def private_address?(addr)
28
28
  ip = IPAddress(addr)
data/lib/ohai/version.rb CHANGED
@@ -19,5 +19,5 @@
19
19
 
20
20
  module Ohai
21
21
  OHAI_ROOT = File.expand_path(__dir__)
22
- VERSION = "17.9.4"
22
+ VERSION = "18.0.14"
23
23
  end
data/ohai.gemspec CHANGED
@@ -14,8 +14,8 @@ Gem::Specification.new do |s|
14
14
 
15
15
  s.required_ruby_version = ">= 2.7"
16
16
 
17
- s.add_dependency "chef-config", ">= 14.12", "< 18"
18
- s.add_dependency "chef-utils", ">= 16.0", "< 18"
17
+ s.add_dependency "chef-config", ">= 14.12", "< 19"
18
+ s.add_dependency "chef-utils", ">= 16.0", "< 19"
19
19
  s.add_dependency "ffi", "~> 1.9"
20
20
  s.add_dependency "ffi-yajl", "~> 2.2"
21
21
  s.add_dependency "ipaddress"
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: 17.9.4
4
+ version: 18.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-12 00:00:00.000000000 Z
11
+ date: 2022-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-config
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '14.12'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '18'
22
+ version: '19'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '14.12'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '18'
32
+ version: '19'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: chef-utils
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: '16.0'
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: '18'
42
+ version: '19'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  version: '16.0'
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: '18'
52
+ version: '19'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: ffi
55
55
  requirement: !ruby/object:Gem::Requirement