facter 4.4.3 → 4.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 27f716e9d00c699494d6da8927733eaf0ff4fa9b5ed7c1f70cef04b11c0c12e4
4
- data.tar.gz: 8a86edd70a726f61fd5522d4f6b35cd61118b91f9beaa3cca28c0f196894121c
3
+ metadata.gz: eb4ad4e8f37099548b19f8b37bc43b11b2f2ba2cfe28df31ffc30b4d8b6aac87
4
+ data.tar.gz: d978305277df30b5f97116aab7d96f1935de8e35db2cee3fdab1aa28db694a78
5
5
  SHA512:
6
- metadata.gz: 29b8779c0d6ec311cb00fe6c69ee018f0bae4bdec421cf5b31cc81c86d684278da8bad544ea6b362f71941b8353c1d39f39f2733d7d088f436dc2d7d9f05cea1
7
- data.tar.gz: 7e7c94fe88097f09e69c69dd57c6b271280735166f6276657726a0a3e9f25b70a082d234f4d44a86102f81e4452c9933246c93042e305ad27aa47928e4fbf1c8
6
+ metadata.gz: 9a0ebd49f8a7ddae37b97c4c2430b93f3fb18b462203daa6544bdfcdbdc28a3c4f1df5b90bbabb17a17fa2e8a1cef28f467e1b5cad70547c616e95e1051c1688
7
+ data.tar.gz: ef0687cb134a6d37e1d4a35ba8047ca134230e0834f5354fc8a3ce6463999b0f237c265b4dbf1d55f45a2cf12276f207f4c5756afd62bbcf2b61abb19ccf0eaa
@@ -53,6 +53,13 @@ module Facter
53
53
  # @api private
54
54
  attr_reader :fact
55
55
 
56
+ # @!attribute [r] last_evaluated
57
+ #
58
+ # @return [String]
59
+ #
60
+ # @api public
61
+ attr_reader :last_evaluated
62
+
56
63
  # Create a new aggregated resolution mechanism.
57
64
  #
58
65
  # @param name [String] The name of the resolution.
@@ -101,7 +108,15 @@ module Facter
101
108
  #
102
109
  # @api private
103
110
  def evaluate(&block)
111
+ if @last_evaluated
112
+ msg = "Already evaluated #{@name}"
113
+ msg << " at #{@last_evaluated}" if msg.is_a? String
114
+ msg << ', reevaluating anyways'
115
+ log.warn msg
116
+ end
104
117
  instance_eval(&block)
118
+
119
+ @last_evaluated = block.source_location.join(':')
105
120
  end
106
121
 
107
122
  # Define a new chunk for the given aggregate
@@ -93,7 +93,12 @@ module LegacyFacter
93
93
  if data == false
94
94
  log.warn "Could not interpret fact file #{fact.file}"
95
95
  elsif (data == {}) || data.nil?
96
- log.debug("Fact file #{fact.file} was parsed but no key=>value data was returned")
96
+ log.debug(
97
+ "Structured data fact file #{fact.file} was parsed but was either empty or an invalid filetype "\
98
+ '(valid filetypes are .yaml, .json, and .txt).'
99
+ )
100
+ elsif !data.is_a?(Hash)
101
+ log.error("Structured data fact file #{fact.file} was parsed but no key=>value data was returned.")
97
102
  else
98
103
  add_data(data, collection, fact, weight)
99
104
  end
@@ -85,7 +85,9 @@ module Facter
85
85
 
86
86
  resolve
87
87
  rescue StandardError => e
88
- log.log_exception("Unable to add resolve #{resolution_name.inspect} for fact #{@name}: #{e.message}")
88
+ msg = "Unable to add resolve #{resolution_name.inspect} for fact '#{@name}': #{e.message}"
89
+ msg += "\n" + e.backtrace.join("\n") if Options[:trace]
90
+ log.error(msg, true)
89
91
  nil
90
92
  end
91
93
 
@@ -223,8 +225,7 @@ module Facter
223
225
  end
224
226
 
225
227
  def log_fact_path(resolve)
226
- fact = resolve.fact
227
- log.debug("#{resolve.fact_type} fact #{fact.name} got resolved from: #{fact.location}")
228
+ log.debug("#{resolve.fact_type} fact #{resolve.fact.name} was resolved from: #{resolve.last_evaluated}")
228
229
  end
229
230
 
230
231
  def announce_when_no_suitable_resolution(resolutions)
@@ -96,14 +96,7 @@ module Facter
96
96
 
97
97
  instance_eval(&block)
98
98
 
99
- # Ruby 1.9+ provides the source location of procs which can provide useful
100
- # debugging information if a resolution is being evaluated twice. Since 1.8
101
- # doesn't support this we opportunistically provide this information.
102
- @last_evaluated = if block.respond_to? :source_location
103
- block.source_location.join(':')
104
- else
105
- true
106
- end
99
+ @last_evaluated = block.source_location.join(':')
107
100
  end
108
101
 
109
102
  # Sets options for the aggregate fact
@@ -6,6 +6,9 @@ module LegacyFacter
6
6
  def self.root?
7
7
  require_relative '../../../facter/resolvers/windows/ffi/identity_ffi'
8
8
  IdentityFFI.privileged?
9
+ rescue LoadError => e
10
+ log = Facter::Log.new(self)
11
+ log.debug("The ffi gem has not been installed: #{e}")
9
12
  end
10
13
  end
11
14
  end
@@ -10,23 +10,27 @@ module Facts
10
10
  macosx_productversion_patch].freeze
11
11
 
12
12
  def call_the_resolver
13
- fact_value = Facter::Resolvers::SwVers.resolve(:productversion)
14
- ver = version_hash(fact_value)
13
+ version_value = Facter::Resolvers::SwVers.resolve(:productversion)
14
+ extra_value = Facter::Resolvers::SwVers.resolve(:productversionextra)
15
+ ver = version_hash(version_value, extra_value)
15
16
 
16
17
  [Facter::ResolvedFact.new(FACT_NAME, ver),
17
- Facter::ResolvedFact.new(ALIASES[0], fact_value, :legacy),
18
+ Facter::ResolvedFact.new(ALIASES[0], version_value, :legacy),
18
19
  Facter::ResolvedFact.new(ALIASES[1], ver['major'], :legacy),
19
20
  Facter::ResolvedFact.new(ALIASES[2], ver['minor'], :legacy),
20
21
  Facter::ResolvedFact.new(ALIASES[3], ver['patch'], :legacy)]
21
22
  end
22
23
 
23
- def version_hash(fact_value)
24
- versions = fact_value.split('.')
24
+ def version_hash(version_value, extra_value)
25
+ versions = version_value.split('.')
25
26
  if versions[0] == '10'
26
- { 'full' => fact_value, 'major' => "#{versions[0]}.#{versions[1]}", 'minor' => versions[-1] }
27
- else
28
- { 'full' => fact_value, 'major' => versions[0], 'minor' => versions.fetch(1, '0'),
27
+ { 'full' => version_value, 'major' => "#{versions[0]}.#{versions[1]}", 'minor' => versions[-1] }
28
+ elsif /11|12/.match?(versions[0]) || extra_value.nil?
29
+ { 'full' => version_value, 'major' => versions[0], 'minor' => versions.fetch(1, '0'),
29
30
  'patch' => versions.fetch(2, '0') }
31
+ else
32
+ { 'full' => version_value, 'major' => versions[0], 'minor' => versions.fetch(1, '0'),
33
+ 'patch' => versions.fetch(2, '0'), 'extra' => extra_value }
30
34
  end
31
35
  end
32
36
  end
@@ -28,9 +28,13 @@ module Facter
28
28
  @fact_list[:interfaces] = Facter::Util::Linux::SocketParser.retrieve_interfaces(log)
29
29
  mtu_and_indexes = interfaces_mtu_and_index
30
30
 
31
- @fact_list[:interfaces].keys.each do |interface_name|
32
- mtu(interface_name, mtu_and_indexes)
33
- dhcp(interface_name, mtu_and_indexes)
31
+ @fact_list[:interfaces].each_pair do |interface_name, iface|
32
+ mtu(interface_name, mtu_and_indexes, iface)
33
+ dhcp(interface_name, mtu_and_indexes, iface)
34
+ operstate(interface_name, iface)
35
+ physical(interface_name, iface)
36
+ linkspeed(interface_name, iface)
37
+ duplex(interface_name, iface)
34
38
 
35
39
  @log.debug("Found interface #{interface_name} with #{@fact_list[:interfaces][interface_name]}")
36
40
  end
@@ -47,6 +51,43 @@ module Facter
47
51
  mtu_and_indexes
48
52
  end
49
53
 
54
+ def operstate(interface_name, iface)
55
+ state = Facter::Util::FileHelper.safe_read("/sys/class/net/#{interface_name}/operstate", nil)
56
+ iface[:operational_state] = state.strip if state
57
+ end
58
+
59
+ def physical(ifname, iface)
60
+ iface[:physical] = if File.exist?("/sys/class/net/#{ifname}/device")
61
+ true
62
+ else
63
+ false
64
+ end
65
+ end
66
+
67
+ def duplex(interface_name, iface)
68
+ return unless iface[:physical]
69
+
70
+ # not all interfaces support this, wifi for example causes an EINVAL (Invalid argument)
71
+ begin
72
+ plex = Facter::Util::FileHelper.safe_read("/sys/class/net/#{interface_name}/duplex", nil)
73
+ iface[:duplex] = plex.strip if plex
74
+ rescue StandardError => e
75
+ @log.debug("Failed to read '/sys/class/net/#{interface_name}/duplex': #{e.message}")
76
+ end
77
+ end
78
+
79
+ def linkspeed(interface_name, iface)
80
+ return unless iface[:physical]
81
+
82
+ # not all interfaces support this, wifi for example causes an EINVAL (Invalid argument)
83
+ begin
84
+ speed = Facter::Util::FileHelper.safe_read("/sys/class/net/#{interface_name}/speed", nil)
85
+ iface[:speed] = speed.strip.to_i if speed
86
+ rescue StandardError => e
87
+ @log.debug("Failed to read '/sys/class/net/#{interface_name}/speed': #{e.message}")
88
+ end
89
+ end
90
+
50
91
  def parse_ip_command_line(line, mtu_and_indexes)
51
92
  mtu = line.match(/mtu (\d+)/)&.captures&.first&.to_i
52
93
  index_tokens = line.split(':')
@@ -56,14 +97,14 @@ module Facter
56
97
  mtu_and_indexes[name] = { index: index, mtu: mtu }
57
98
  end
58
99
 
59
- def mtu(interface_name, mtu_and_indexes)
100
+ def mtu(interface_name, mtu_and_indexes, iface)
60
101
  mtu = mtu_and_indexes.dig(interface_name, :mtu)
61
- @fact_list[:interfaces][interface_name][:mtu] = mtu unless mtu.nil?
102
+ iface[:mtu] = mtu unless mtu.nil?
62
103
  end
63
104
 
64
- def dhcp(interface_name, mtu_and_indexes)
105
+ def dhcp(interface_name, mtu_and_indexes, iface)
65
106
  dhcp = Facter::Util::Linux::Dhcp.dhcp(interface_name, mtu_and_indexes.dig(interface_name, :index), log)
66
- @fact_list[:interfaces][interface_name][:dhcp] = dhcp unless dhcp.nil?
107
+ iface[:dhcp] = dhcp unless dhcp.nil?
67
108
  end
68
109
 
69
110
  def add_info_from_routing_table
@@ -7,6 +7,8 @@ module Facter
7
7
  include Facter::Util::Resolvers::FilesystemHelper
8
8
  init_resolver
9
9
 
10
+ @log = Facter::Log.new(self)
11
+
10
12
  class << self
11
13
  private
12
14
 
@@ -16,18 +18,21 @@ module Facter
16
18
 
17
19
  def read_mounts
18
20
  mounts = {}
21
+ begin
22
+ Facter::Util::Resolvers::FilesystemHelper.read_mountpoints.each do |fs|
23
+ device = fs.name
24
+ filesystem = fs.mount_type
25
+ path = fs.mount_point
26
+ options = read_options(fs.options)
19
27
 
20
- Facter::Util::Resolvers::FilesystemHelper.read_mountpoints.each do |fs|
21
- device = fs.name
22
- filesystem = fs.mount_type
23
- path = fs.mount_point
24
- options = read_options(fs.options)
25
-
26
- mounts[path] = read_stats(path).tap do |hash|
27
- hash[:device] = device
28
- hash[:filesystem] = filesystem
29
- hash[:options] = options if options.any?
28
+ mounts[path] = read_stats(path).tap do |hash|
29
+ hash[:device] = device
30
+ hash[:filesystem] = filesystem
31
+ hash[:options] = options if options.any?
32
+ end
30
33
  end
34
+ rescue LoadError => e
35
+ @log.debug("Could not read mounts: #{e}")
31
36
  end
32
37
 
33
38
  @fact_list[:mountpoints] = mounts
@@ -39,7 +44,7 @@ module Facter
39
44
  size_bytes = stats.bytes_total
40
45
  available_bytes = stats.bytes_available
41
46
  used_bytes = size_bytes - available_bytes
42
- rescue Sys::Filesystem::Error
47
+ rescue Sys::Filesystem::Error, LoadError
43
48
  size_bytes = used_bytes = available_bytes = 0
44
49
  end
45
50
 
@@ -45,14 +45,20 @@ module Facter
45
45
 
46
46
  def read_mounts(fact_name)
47
47
  mounts = []
48
- Facter::Util::Resolvers::FilesystemHelper.read_mountpoints.each do |file_system|
49
- mount = {}
50
- get_mount_data(file_system, mount)
51
-
52
- next if mount[:path] =~ %r{^/(proc|sys)} && mount[:filesystem] != 'tmpfs' || mount[:filesystem] == 'autofs'
53
-
54
- get_mount_sizes(mount)
55
- mounts << mount
48
+ begin
49
+ Facter::Util::Resolvers::FilesystemHelper.read_mountpoints.each do |file_system|
50
+ mount = {}
51
+ get_mount_data(file_system, mount)
52
+
53
+ if mount[:path] =~ %r{^/(proc|sys)} && mount[:filesystem] != 'tmpfs' || mount[:filesystem] == 'autofs'
54
+ next
55
+ end
56
+
57
+ get_mount_sizes(mount)
58
+ mounts << mount
59
+ end
60
+ rescue LoadError => e
61
+ @log.debug("Could not read mounts: #{e}")
56
62
  end
57
63
 
58
64
  @fact_list[:mountpoints] = mounts
@@ -70,7 +76,7 @@ module Facter
70
76
  begin
71
77
  stats = Facter::Util::Resolvers::FilesystemHelper.read_mountpoint_stats(mount[:path])
72
78
  get_bytes_data(mount, stats)
73
- rescue Sys::Filesystem::Error => e
79
+ rescue LoadError, Sys::Filesystem::Error => e
74
80
  @log.debug("Could not get stats for mountpoint #{mount[:path]}, got #{e}")
75
81
  mount[:size_bytes] = mount[:available_bytes] = mount[:used_bytes] = 0
76
82
  end
@@ -19,6 +19,12 @@ module Facter
19
19
 
20
20
  matches = output.match(/System Configuration:\s+(.+?)\s+sun\d+\S+\s+(.+)/)&.captures
21
21
 
22
+ # There are circumstances (e.g. in non-global zones) when prtdiag
23
+ # will return text, but it's an error message or some other string
24
+ # that isn't parsed by the above match/capture. In that case, we
25
+ # simply return.
26
+ return if matches.nil?
27
+
22
28
  @fact_list[:manufacturer] = matches[0]&.strip
23
29
  @fact_list[:product_name] = matches[1]&.strip
24
30
 
@@ -7,6 +7,8 @@ module Facter
7
7
  include Facter::Util::Resolvers::FilesystemHelper
8
8
  init_resolver
9
9
 
10
+ @log = Facter::Log.new(self)
11
+
10
12
  class << self
11
13
  private
12
14
 
@@ -24,31 +26,34 @@ module Facter
24
26
  def read_mounts(fact_name) # rubocop:disable Metrics/MethodLength
25
27
  @mounts = []
26
28
  @auto_home_paths = []
29
+ begin
30
+ Facter::Util::Resolvers::FilesystemHelper.read_mountpoints&.each do |fs|
31
+ if fs.name == 'auto_home'
32
+ @auto_home_paths << fs.mount_point
33
+ next
34
+ end
27
35
 
28
- Facter::Util::Resolvers::FilesystemHelper.read_mountpoints&.each do |fs|
29
- if fs.name == 'auto_home'
30
- @auto_home_paths << fs.mount_point
31
- next
32
- end
36
+ next if fs.mount_type == 'autofs'
33
37
 
34
- next if fs.mount_type == 'autofs'
38
+ mounts = {}
39
+ device = fs.name
40
+ filesystem = fs.mount_type
41
+ path = fs.mount_point
42
+ options = fs.options.split(',').map(&:strip)
35
43
 
36
- mounts = {}
37
- device = fs.name
38
- filesystem = fs.mount_type
39
- path = fs.mount_point
40
- options = fs.options.split(',').map(&:strip)
44
+ mounts = read_stats(path).tap do |hash|
45
+ hash[:device] = device
46
+ hash[:filesystem] = filesystem
47
+ hash[:path] = path
48
+ hash[:options] = options if options.any?
49
+ end
41
50
 
42
- mounts = read_stats(path).tap do |hash|
43
- hash[:device] = device
44
- hash[:filesystem] = filesystem
45
- hash[:path] = path
46
- hash[:options] = options if options.any?
51
+ @mounts << Hash[Facter::Util::Resolvers::FilesystemHelper::MOUNT_KEYS
52
+ .zip(Facter::Util::Resolvers::FilesystemHelper::MOUNT_KEYS
53
+ .map { |v| mounts[v] })]
47
54
  end
48
-
49
- @mounts << Hash[Facter::Util::Resolvers::FilesystemHelper::MOUNT_KEYS
50
- .zip(Facter::Util::Resolvers::FilesystemHelper::MOUNT_KEYS
51
- .map { |v| mounts[v] })]
55
+ rescue LoadError => e
56
+ @log.debug("Could not read mounts: #{e}")
52
57
  end
53
58
 
54
59
  exclude_auto_home_mounts!
@@ -64,7 +69,7 @@ module Facter
64
69
  available_bytes = stats.bytes_available.abs
65
70
  used_bytes = stats.bytes_used.abs
66
71
  total_bytes = used_bytes + available_bytes
67
- rescue Sys::Filesystem::Error
72
+ rescue Sys::Filesystem::Error, LoadError
68
73
  size_bytes = used_bytes = available_bytes = 0
69
74
  end
70
75
 
@@ -5,6 +5,7 @@ module Facter
5
5
  class SwVers < BaseResolver
6
6
  # :productname
7
7
  # :productversion
8
+ # :productversionextra
8
9
  # :buildversion
9
10
 
10
11
  init_resolver
@@ -23,6 +23,9 @@ module Facter
23
23
  arch = determine_architecture(hard)
24
24
  build_facts_list(hardware: hard, architecture: arch)
25
25
  @fact_list[fact_name]
26
+ rescue LoadError => e
27
+ log = Facter::Log.new(self)
28
+ log.debug("The ffi gem has not been installed: #{e}")
26
29
  end
27
30
 
28
31
  def determine_hardware(sys_info)
@@ -32,6 +32,8 @@ module Facter
32
32
  end
33
33
 
34
34
  { user: name_ptr.read_wide_string_with_length(size_ptr.read_uint32), privileged: IdentityFFI.privileged? }
35
+ rescue LoadError => e
36
+ @log.debug("Could not find username: #{e}")
35
37
  end
36
38
 
37
39
  def retrieve_facts(fact_name)
@@ -30,6 +30,8 @@ module Facter
30
30
  build_facts_list(result)
31
31
 
32
32
  @fact_list[fact_name]
33
+ rescue LoadError => e
34
+ @log.debug("Could not get OS version information: #{e}")
33
35
  end
34
36
 
35
37
  def build_facts_list(result)
@@ -28,6 +28,8 @@ module Facter
28
28
  @long_living_pointer = state_ptr
29
29
 
30
30
  PerformanceInformation.new(state_ptr)
31
+ rescue LoadError => e
32
+ @log.debug("Could not resolve memory facts: #{e}")
31
33
  end
32
34
 
33
35
  def calculate_memory
@@ -31,6 +31,8 @@ module Facter
31
31
  Facter::Util::Resolvers::Networking.expand_main_bindings(@fact_list)
32
32
 
33
33
  @fact_list[fact_name]
34
+ rescue LoadError => e
35
+ @log.debug("The ffi gem has not been installed: #{e}")
34
36
  end
35
37
 
36
38
  def get_adapter_addresses(size_ptr, adapter_addresses, flags)
@@ -31,6 +31,8 @@ module Facter
31
31
  end
32
32
 
33
33
  @fact_list[:system32] = construct_path(bool_ptr, windows_path)
34
+ rescue LoadError => e
35
+ @log.debug("Could not retrieve: #{e}")
34
36
  end
35
37
 
36
38
  def construct_path(bool_ptr, windows)
@@ -33,6 +33,9 @@ module Facter
33
33
  def codepage_from_api
34
34
  require_relative '../../../facter/resolvers/windows/ffi/winnls_ffi'
35
35
  WinnlsFFI.GetACP.to_s
36
+ rescue LoadError => e
37
+ log = Facter::Log.new(self)
38
+ log.debug("Could not retrieve codepage: #{e}")
36
39
  end
37
40
  end
38
41
  end
@@ -22,13 +22,12 @@ module Facter
22
22
  default_return
23
23
  end
24
24
 
25
+ # This previously acted as a helper method for versions of Ruby older
26
+ # than 2.5, before Dir.children was added. As it isn't a private
27
+ # method, we can't remove it entirely until the next major Facter
28
+ # release (presumably Facter 5).
25
29
  def dir_children(path)
26
- children = if RUBY_VERSION.to_f < 2.5
27
- Dir.entries(path).reject { |dir| ['.', '..'].include?(dir) }
28
- else
29
- Dir.children(path)
30
- end
31
-
30
+ children = Dir.children(path)
32
31
  children
33
32
  end
34
33
 
@@ -9,9 +9,7 @@ module Facter
9
9
  size_bytes used used_bytes capacity].freeze
10
10
  class << self
11
11
  def read_mountpoints
12
- # TODO: this require must be replaced with "require 'sys/filesystem'" when a new release of
13
- # djberg96/sys-filesystem gem is available
14
- require_relative '../../patches/sysfilesystem/sys/statvfs.rb'
12
+ require 'sys/filesystem'
15
13
  force_utf(Sys::Filesystem.mounts)
16
14
  end
17
15
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Facter
4
- VERSION = '4.4.3' unless defined?(VERSION)
4
+ VERSION = '4.5.1' unless defined?(VERSION)
5
5
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facter
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.3
4
+ version: 4.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-24 00:00:00.000000000 Z
11
+ date: 2023-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ffi
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 1.15.5
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 1.15.5
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rake
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -101,49 +115,49 @@ dependencies:
101
115
  - !ruby/object:Gem::Version
102
116
  version: 0.17.1
103
117
  - !ruby/object:Gem::Dependency
104
- name: webmock
118
+ name: sys-filesystem
105
119
  requirement: !ruby/object:Gem::Requirement
106
120
  requirements:
107
121
  - - "~>"
108
122
  - !ruby/object:Gem::Version
109
- version: '3.12'
123
+ version: '1.4'
110
124
  type: :development
111
125
  prerelease: false
112
126
  version_requirements: !ruby/object:Gem::Requirement
113
127
  requirements:
114
128
  - - "~>"
115
129
  - !ruby/object:Gem::Version
116
- version: '3.12'
130
+ version: '1.4'
117
131
  - !ruby/object:Gem::Dependency
118
- name: yard
132
+ name: webmock
119
133
  requirement: !ruby/object:Gem::Requirement
120
134
  requirements:
121
135
  - - "~>"
122
136
  - !ruby/object:Gem::Version
123
- version: '0.9'
137
+ version: '3.12'
124
138
  type: :development
125
139
  prerelease: false
126
140
  version_requirements: !ruby/object:Gem::Requirement
127
141
  requirements:
128
142
  - - "~>"
129
143
  - !ruby/object:Gem::Version
130
- version: '0.9'
144
+ version: '3.12'
131
145
  - !ruby/object:Gem::Dependency
132
- name: hocon
146
+ name: yard
133
147
  requirement: !ruby/object:Gem::Requirement
134
148
  requirements:
135
149
  - - "~>"
136
150
  - !ruby/object:Gem::Version
137
- version: '1.3'
138
- type: :runtime
151
+ version: '0.9'
152
+ type: :development
139
153
  prerelease: false
140
154
  version_requirements: !ruby/object:Gem::Requirement
141
155
  requirements:
142
156
  - - "~>"
143
157
  - !ruby/object:Gem::Version
144
- version: '1.3'
158
+ version: '0.9'
145
159
  - !ruby/object:Gem::Dependency
146
- name: sys-filesystem
160
+ name: hocon
147
161
  requirement: !ruby/object:Gem::Requirement
148
162
  requirements:
149
163
  - - "~>"
@@ -903,7 +917,6 @@ files:
903
917
  - lib/facter/models/loaded_fact.rb
904
918
  - lib/facter/models/resolved_fact.rb
905
919
  - lib/facter/models/searched_fact.rb
906
- - lib/facter/patches/sysfilesystem/sys/statvfs.rb
907
920
  - lib/facter/resolvers/aio_agent_version.rb
908
921
  - lib/facter/resolvers/aix/architecture.rb
909
922
  - lib/facter/resolvers/aix/disks.rb
@@ -1088,7 +1101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1088
1101
  - !ruby/object:Gem::Version
1089
1102
  version: '0'
1090
1103
  requirements: []
1091
- rubygems_version: 3.4.12
1104
+ rubygems_version: 3.4.20
1092
1105
  signing_key:
1093
1106
  specification_version: 4
1094
1107
  summary: Facter, a system inventory tool
@@ -1,92 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'sys/filesystem'
4
-
5
- module Sys
6
- class Filesystem
7
- module Structs
8
- class Statvfs < FFI::Struct
9
- # We must remove the instance variable layout defined by sys-filesystem, because setting
10
- # it the second time will make FFI log a warning message.
11
- remove_instance_variable(:@layout) if @layout
12
-
13
- if /darwin|osx|mach/i.match?(RbConfig::CONFIG['host_os'])
14
- layout(
15
- :f_bsize, :ulong,
16
- :f_frsize, :ulong,
17
- :f_blocks, :uint,
18
- :f_bfree, :uint,
19
- :f_bavail, :uint,
20
- :f_files, :uint,
21
- :f_ffree, :uint,
22
- :f_favail, :uint,
23
- :f_fsid, :ulong,
24
- :f_flag, :ulong,
25
- :f_namemax, :ulong
26
- )
27
- elsif /bsd/i.match?(RbConfig::CONFIG['host'])
28
- layout(
29
- :f_bavail, :uint64,
30
- :f_bfree, :uint64,
31
- :f_blocks, :uint64,
32
- :f_favail, :uint64,
33
- :f_ffree, :uint64,
34
- :f_files, :uint64,
35
- :f_bsize, :ulong,
36
- :f_flag, :ulong,
37
- :f_frsize, :ulong,
38
- :f_fsid, :ulong,
39
- :f_namemax, :ulong
40
- )
41
- elsif /sunos|solaris/i.match?(RbConfig::CONFIG['host'])
42
- layout(
43
- :f_bsize, :ulong,
44
- :f_frsize, :ulong,
45
- :f_blocks, :uint64_t,
46
- :f_bfree, :uint64_t,
47
- :f_bavail, :uint64_t,
48
- :f_files, :uint64_t,
49
- :f_ffree, :uint64_t,
50
- :f_favail, :uint64_t,
51
- :f_fsid, :ulong,
52
- :f_basetype, [:char, 16],
53
- :f_flag, :ulong,
54
- :f_namemax, :ulong,
55
- :f_fstr, [:char, 32],
56
- :f_filler, [:ulong, 16]
57
- )
58
- elsif /i686/i.match?(RbConfig::CONFIG['host'])
59
- layout(
60
- :f_bsize, :ulong,
61
- :f_frsize, :ulong,
62
- :f_blocks, :uint,
63
- :f_bfree, :uint,
64
- :f_bavail, :uint,
65
- :f_files, :uint,
66
- :f_ffree, :uint,
67
- :f_favail, :uint,
68
- :f_fsid, :ulong,
69
- :f_flag, :ulong,
70
- :f_namemax, :ulong,
71
- :f_spare, [:int, 6]
72
- )
73
- else
74
- layout(
75
- :f_bsize, :ulong,
76
- :f_frsize, :ulong,
77
- :f_blocks, :uint64,
78
- :f_bfree, :uint64,
79
- :f_bavail, :uint64,
80
- :f_files, :uint64,
81
- :f_ffree, :uint64,
82
- :f_favail, :uint64,
83
- :f_fsid, :ulong,
84
- :f_flag, :ulong,
85
- :f_namemax, :ulong,
86
- :f_spare, [:int, 6]
87
- )
88
- end
89
- end
90
- end
91
- end
92
- end