facter 4.0.50 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. checksums.yaml +4 -4
  2. data/lib/docs/generate_cli.rb +7 -0
  3. data/lib/facter.rb +90 -56
  4. data/lib/facter/config.rb +2 -0
  5. data/lib/facter/custom_facts/core/aggregate.rb +9 -0
  6. data/lib/facter/custom_facts/core/execution/base.rb +7 -3
  7. data/lib/facter/custom_facts/core/execution/popen3.rb +13 -1
  8. data/lib/facter/custom_facts/core/execution/posix.rb +2 -2
  9. data/lib/facter/custom_facts/core/execution/windows.rb +1 -1
  10. data/lib/facter/custom_facts/core/resolvable.rb +11 -0
  11. data/lib/facter/custom_facts/util/collection.rb +5 -0
  12. data/lib/facter/custom_facts/util/directory_loader.rb +1 -1
  13. data/lib/facter/custom_facts/util/normalization.rb +7 -2
  14. data/lib/facter/custom_facts/util/resolution.rb +2 -0
  15. data/lib/facter/custom_facts/util/windows_root.rb +2 -1
  16. data/lib/facter/facts/aix/processors/cores.rb +16 -0
  17. data/lib/facter/facts/aix/processors/threads.rb +16 -0
  18. data/lib/facter/facts/amzn/lsbdistcodename.rb +16 -0
  19. data/lib/facter/facts/amzn/lsbdistdescription.rb +16 -0
  20. data/lib/facter/facts/amzn/lsbdistid.rb +16 -0
  21. data/lib/facter/facts/amzn/os/distro/codename.rb +24 -0
  22. data/lib/facter/facts/amzn/os/distro/description.rb +21 -0
  23. data/lib/facter/facts/amzn/os/distro/id.rb +21 -0
  24. data/lib/facter/facts/amzn/os/distro/release.rb +32 -0
  25. data/lib/facter/facts/freebsd/is_virtual.rb +1 -5
  26. data/lib/facter/facts/freebsd/virtual.rb +1 -2
  27. data/lib/facter/facts/linux/az_metadata.rb +23 -0
  28. data/lib/facter/facts/linux/cloud/provider.rb +20 -0
  29. data/lib/facter/facts/linux/dhcp_servers.rb +2 -2
  30. data/lib/facter/facts/linux/ec2_metadata.rb +1 -5
  31. data/lib/facter/facts/linux/ec2_userdata.rb +1 -5
  32. data/lib/facter/facts/linux/hypervisors/xen.rb +1 -4
  33. data/lib/facter/facts/linux/interfaces.rb +1 -1
  34. data/lib/facter/facts/linux/ipaddress6_interfaces.rb +1 -1
  35. data/lib/facter/facts/linux/ipaddress_interfaces.rb +1 -1
  36. data/lib/facter/facts/linux/is_virtual.rb +1 -5
  37. data/lib/facter/facts/linux/macaddress_interfaces.rb +1 -1
  38. data/lib/facter/facts/linux/mtu_interfaces.rb +1 -1
  39. data/lib/facter/facts/linux/netmask6_interfaces.rb +1 -1
  40. data/lib/facter/facts/linux/netmask_interfaces.rb +1 -1
  41. data/lib/facter/facts/linux/network6_interfaces.rb +1 -1
  42. data/lib/facter/facts/linux/network_interfaces.rb +1 -1
  43. data/lib/facter/facts/linux/networking/dhcp.rb +1 -1
  44. data/lib/facter/facts/linux/networking/domain.rb +1 -1
  45. data/lib/facter/facts/linux/networking/fqdn.rb +1 -1
  46. data/lib/facter/facts/linux/networking/hostname.rb +1 -1
  47. data/lib/facter/facts/linux/networking/interfaces.rb +1 -1
  48. data/lib/facter/facts/linux/networking/ip.rb +1 -1
  49. data/lib/facter/facts/linux/networking/ip6.rb +1 -1
  50. data/lib/facter/facts/linux/networking/mac.rb +1 -1
  51. data/lib/facter/facts/linux/networking/mtu.rb +1 -1
  52. data/lib/facter/facts/linux/networking/netmask.rb +1 -1
  53. data/lib/facter/facts/linux/networking/netmask6.rb +1 -1
  54. data/lib/facter/facts/linux/networking/network.rb +1 -1
  55. data/lib/facter/facts/linux/networking/network6.rb +1 -1
  56. data/lib/facter/facts/linux/networking/primary.rb +1 -1
  57. data/lib/facter/facts/linux/networking/scope6.rb +1 -1
  58. data/lib/facter/facts/linux/processors/cores.rb +16 -0
  59. data/lib/facter/facts/linux/processors/threads.rb +16 -0
  60. data/lib/facter/facts/linux/scope6_interfaces.rb +1 -1
  61. data/lib/facter/facts/linux/virtual.rb +1 -2
  62. data/lib/facter/facts/macosx/os/macosx/version.rb +15 -4
  63. data/lib/facter/facts/macosx/processors/cores.rb +16 -0
  64. data/lib/facter/facts/macosx/processors/threads.rb +16 -0
  65. data/lib/facter/facts/rhel/lsbdistcodename.rb +16 -0
  66. data/lib/facter/facts/rhel/lsbdistdescription.rb +16 -0
  67. data/lib/facter/facts/rhel/lsbdistid.rb +16 -0
  68. data/lib/facter/facts/rhel/os/distro/codename.rb +2 -4
  69. data/lib/facter/facts/rhel/os/distro/description.rb +2 -4
  70. data/lib/facter/facts/rhel/os/distro/id.rb +2 -4
  71. data/lib/facter/facts/rhel/os/distro/release.rb +13 -12
  72. data/lib/facter/facts/sles/lsbdistcodename.rb +16 -0
  73. data/lib/facter/facts/sles/lsbdistdescription.rb +16 -0
  74. data/lib/facter/facts/sles/lsbdistid.rb +16 -0
  75. data/lib/facter/facts/sles/os/distro/codename.rb +3 -4
  76. data/lib/facter/facts/sles/os/distro/description.rb +2 -5
  77. data/lib/facter/facts/sles/os/distro/id.rb +6 -5
  78. data/lib/facter/facts/sles/os/distro/release.rb +17 -12
  79. data/lib/facter/facts/solaris/hypervisors/ldom.rb +1 -1
  80. data/lib/facter/facts/solaris/hypervisors/zone.rb +1 -1
  81. data/lib/facter/facts/solaris/mountpoints.rb +1 -1
  82. data/lib/facter/facts/solaris/processors/cores.rb +16 -0
  83. data/lib/facter/facts/solaris/processors/threads.rb +16 -0
  84. data/lib/facter/facts/ubuntu/lsbdistrelease.rb +2 -2
  85. data/lib/facter/facts/windows/az_metadata.rb +23 -0
  86. data/lib/facter/facts/windows/cloud/provider.rb +21 -0
  87. data/lib/facter/facts/windows/ec2_metadata.rb +1 -1
  88. data/lib/facter/facts/windows/ec2_userdata.rb +1 -1
  89. data/lib/facter/facts/windows/gce.rb +1 -1
  90. data/lib/facter/facts/windows/hypervisors/hyperv.rb +1 -1
  91. data/lib/facter/facts/windows/hypervisors/kvm.rb +2 -1
  92. data/lib/facter/facts/windows/hypervisors/virtualbox.rb +2 -2
  93. data/lib/facter/facts/windows/hypervisors/vmware.rb +1 -1
  94. data/lib/facter/facts/windows/hypervisors/xen.rb +3 -1
  95. data/lib/facter/facts/windows/is_virtual.rb +15 -0
  96. data/lib/facter/facts/windows/{virtualization/is_virtual.rb → processors/cores.rb} +4 -4
  97. data/lib/facter/facts/windows/{virtualization/virtual.rb → processors/threads.rb} +4 -4
  98. data/lib/facter/facts/windows/virtual.rb +15 -0
  99. data/lib/facter/framework/cli/cli.rb +6 -8
  100. data/lib/facter/framework/config/config_reader.rb +2 -0
  101. data/lib/facter/framework/config/fact_groups.rb +25 -2
  102. data/lib/facter/framework/core/cache_manager.rb +7 -3
  103. data/lib/facter/framework/core/fact/external/external_fact_manager.rb +0 -1
  104. data/lib/facter/framework/core/fact/internal/internal_fact_manager.rb +41 -39
  105. data/lib/facter/framework/core/fact_filter.rb +5 -15
  106. data/lib/facter/framework/core/fact_loaders/external_fact_loader.rb +9 -6
  107. data/lib/facter/framework/core/fact_loaders/fact_loader.rb +39 -37
  108. data/lib/facter/framework/core/fact_manager.rb +84 -14
  109. data/lib/facter/framework/core/file_loader.rb +1 -1
  110. data/lib/facter/framework/core/options.rb +1 -2
  111. data/lib/facter/framework/core/options/config_file_options.rb +7 -0
  112. data/lib/facter/framework/core/options/option_store.rb +12 -6
  113. data/lib/facter/framework/formatters/formatter_helper.rb +3 -5
  114. data/lib/facter/framework/logging/logger.rb +4 -4
  115. data/lib/facter/framework/parsers/query_parser.rb +5 -12
  116. data/lib/facter/models/fact_collection.rb +48 -5
  117. data/lib/facter/models/resolved_fact.rb +2 -3
  118. data/lib/facter/models/searched_fact.rb +2 -3
  119. data/lib/facter/resolvers/aix/ffi/ffi_helper.rb +1 -1
  120. data/lib/facter/resolvers/aix/processors.rb +4 -0
  121. data/lib/facter/resolvers/az.rb +39 -0
  122. data/lib/facter/resolvers/base_resolver.rb +2 -2
  123. data/lib/facter/resolvers/dmi_decode.rb +0 -1
  124. data/lib/facter/resolvers/linux/hostname.rb +126 -0
  125. data/lib/facter/resolvers/linux/networking.rb +124 -0
  126. data/lib/facter/resolvers/macosx/mountpoints.rb +14 -1
  127. data/lib/facter/resolvers/macosx/processor.rb +16 -1
  128. data/lib/facter/resolvers/mountpoints.rb +16 -8
  129. data/lib/facter/resolvers/networking.rb +3 -2
  130. data/lib/facter/resolvers/partitions.rb +1 -1
  131. data/lib/facter/resolvers/processors_lscpu.rb +44 -0
  132. data/lib/facter/resolvers/redhat_release.rb +28 -12
  133. data/lib/facter/resolvers/ruby.rb +1 -1
  134. data/lib/facter/resolvers/selinux.rb +5 -7
  135. data/lib/facter/resolvers/solaris/ffi/functions.rb +1 -1
  136. data/lib/facter/resolvers/solaris/ffi/structs.rb +12 -0
  137. data/lib/facter/resolvers/solaris/mountpoints.rb +22 -16
  138. data/lib/facter/resolvers/solaris/networking.rb +20 -5
  139. data/lib/facter/resolvers/solaris/processors.rb +7 -0
  140. data/lib/facter/resolvers/solaris/zone.rb +0 -1
  141. data/lib/facter/resolvers/windows/ffi/identity_ffi.rb +5 -0
  142. data/lib/facter/resolvers/windows/identity.rb +1 -6
  143. data/lib/facter/resolvers/windows/processors.rb +41 -4
  144. data/lib/facter/resolvers/windows/uptime.rb +3 -22
  145. data/lib/facter/resolvers/windows/virtualization.rb +46 -44
  146. data/lib/facter/resolvers/xen.rb +6 -1
  147. data/lib/facter/templates/man.erb +13 -5
  148. data/lib/facter/util/facts/posix/virtual_detector.rb +74 -0
  149. data/lib/facter/util/facts/unit_converter.rb +2 -2
  150. data/lib/facter/util/linux/dhcp.rb +86 -0
  151. data/lib/facter/util/linux/if_inet6.rb +73 -0
  152. data/lib/facter/util/linux/routing_table.rb +60 -0
  153. data/lib/facter/util/linux/socket_parser.rb +114 -0
  154. data/lib/facter/util/resolvers/ffi/hostname.rb +70 -0
  155. data/lib/facter/util/resolvers/http.rb +7 -1
  156. data/lib/facter/util/resolvers/networking/primary_interface.rb +11 -5
  157. data/lib/facter/util/utils.rb +18 -1
  158. data/lib/facter/version.rb +1 -1
  159. metadata +63 -13
  160. data/lib/facter/facts/linux/cloud.rb +0 -15
  161. data/lib/facter/framework/core/fact_augmenter.rb +0 -37
  162. data/lib/facter/resolvers/cloud.rb +0 -39
  163. data/lib/facter/resolvers/networking_linux.rb +0 -296
  164. data/lib/facter/util/facts/virtual_detector.rb +0 -90
@@ -4,7 +4,8 @@ module LegacyFacter
4
4
  module Util
5
5
  module Root
6
6
  def self.root?
7
- Facter::Resolvers::Identity.resolve(:privileged)
7
+ require 'facter/resolvers/windows/ffi/identity_ffi'
8
+ IdentityFFI.privileged?
8
9
  end
9
10
  end
10
11
  end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Facts
4
+ module Aix
5
+ module Processors
6
+ class Cores
7
+ FACT_NAME = 'processors.cores'
8
+
9
+ def call_the_resolver
10
+ fact_value = Facter::Resolvers::Aix::Processors.resolve(:cores_per_socket)
11
+ Facter::ResolvedFact.new(FACT_NAME, fact_value)
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Facts
4
+ module Aix
5
+ module Processors
6
+ class Threads
7
+ FACT_NAME = 'processors.threads'
8
+
9
+ def call_the_resolver
10
+ fact_value = Facter::Resolvers::Aix::Processors.resolve(:threads_per_core)
11
+ Facter::ResolvedFact.new(FACT_NAME, fact_value)
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Facts
4
+ module Amzn
5
+ class Lsbdistcodename
6
+ FACT_NAME = 'lsbdistcodename'
7
+ TYPE = :legacy
8
+
9
+ def call_the_resolver
10
+ fact_value = Facter::Resolvers::LsbRelease.resolve(:codename)
11
+
12
+ Facter::ResolvedFact.new(FACT_NAME, fact_value, :legacy)
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Facts
4
+ module Amzn
5
+ class Lsbdistdescription
6
+ FACT_NAME = 'lsbdistdescription'
7
+ TYPE = :legacy
8
+
9
+ def call_the_resolver
10
+ fact_value = Facter::Resolvers::LsbRelease.resolve(:description)
11
+
12
+ Facter::ResolvedFact.new(FACT_NAME, fact_value, :legacy)
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Facts
4
+ module Amzn
5
+ class Lsbdistid
6
+ FACT_NAME = 'lsbdistid'
7
+ TYPE = :legacy
8
+
9
+ def call_the_resolver
10
+ fact_value = Facter::Resolvers::LsbRelease.resolve(:distributor_id)
11
+
12
+ Facter::ResolvedFact.new(FACT_NAME, fact_value, :legacy)
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Facts
4
+ module Amzn
5
+ module Os
6
+ module Distro
7
+ class Codename
8
+ FACT_NAME = 'os.distro.codename'
9
+
10
+ def call_the_resolver
11
+ fact_value = Facter::Resolvers::SpecificReleaseFile.resolve(
12
+ :release, release_file: '/etc/system-release'
13
+ ).match(/.*release.*(\(.*\)).*/)
14
+
15
+ fact_value = fact_value[1].gsub(/\(|\)/, '') if fact_value
16
+ fact_value ||= 'n/a'
17
+
18
+ Facter::ResolvedFact.new(FACT_NAME, fact_value)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Facts
4
+ module Amzn
5
+ module Os
6
+ module Distro
7
+ class Description
8
+ FACT_NAME = 'os.distro.description'
9
+
10
+ def call_the_resolver
11
+ fact_value = Facter::Resolvers::SpecificReleaseFile.resolve(
12
+ :release, release_file: '/etc/system-release'
13
+ )
14
+
15
+ Facter::ResolvedFact.new(FACT_NAME, fact_value)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Facts
4
+ module Amzn
5
+ module Os
6
+ module Distro
7
+ class Id
8
+ FACT_NAME = 'os.distro.id'
9
+
10
+ def call_the_resolver
11
+ fact_value = Facter::Resolvers::SpecificReleaseFile.resolve(
12
+ :release, release_file: '/etc/system-release'
13
+ ).split('release')[0].split.reject { |el| el.casecmp('linux').zero? }.join
14
+
15
+ Facter::ResolvedFact.new(FACT_NAME, fact_value)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Facts
4
+ module Amzn
5
+ module Os
6
+ module Distro
7
+ class Release
8
+ FACT_NAME = 'os.distro.release'
9
+ ALIASES = %w[lsbdistrelease lsbmajdistrelease lsbminordistrelease].freeze
10
+
11
+ def call_the_resolver
12
+ version = determine_release_version
13
+
14
+ return Facter::ResolvedFact.new(FACT_NAME, nil) unless version
15
+
16
+ [Facter::ResolvedFact.new(FACT_NAME, version),
17
+ Facter::ResolvedFact.new(ALIASES[0], version['full'], :legacy),
18
+ Facter::ResolvedFact.new(ALIASES[1], version['major'], :legacy),
19
+ Facter::ResolvedFact.new(ALIASES[2], version['minor'], :legacy)]
20
+ end
21
+
22
+ def determine_release_version
23
+ version = Facter::Resolvers::ReleaseFromFirstLine.resolve(:release, release_file: '/etc/system-release')
24
+ version ||= Facter::Resolvers::OsRelease.resolve(:version_id)
25
+
26
+ Facter::Util::Facts.release_hash_from_string(version)
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -5,12 +5,8 @@ module Facts
5
5
  class IsVirtual
6
6
  FACT_NAME = 'is_virtual'
7
7
 
8
- def initialize
9
- @virtual = Facter::Util::Facts::VirtualDetector.new
10
- end
11
-
12
8
  def call_the_resolver
13
- fact_value = @virtual.platform
9
+ fact_value = Facter::Util::Facts::Posix::VirtualDetector.platform
14
10
 
15
11
  Facter::ResolvedFact.new(FACT_NAME, check_if_virtual(fact_value))
16
12
  end
@@ -7,12 +7,11 @@ module Facts
7
7
 
8
8
  def initialize
9
9
  @log = Facter::Log.new(self)
10
- @virtual = Facter::Util::Facts::VirtualDetector.new
11
10
  end
12
11
 
13
12
  def call_the_resolver
14
13
  @log.debug('FreeBSD Virtual Resolver')
15
- fact_value = @virtual.platform
14
+ fact_value = Facter::Util::Facts::Posix::VirtualDetector.platform
16
15
  @log.debug("Fact value is: #{fact_value}")
17
16
 
18
17
  Facter::ResolvedFact.new(FACT_NAME, fact_value)
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Facts
4
+ module Linux
5
+ class AzMetadata
6
+ FACT_NAME = 'az_metadata'
7
+
8
+ def call_the_resolver
9
+ return Facter::ResolvedFact.new(FACT_NAME, nil) unless azure_hypervisor?
10
+
11
+ fact_value = Facter::Resolvers::Az.resolve(:metadata)
12
+
13
+ Facter::ResolvedFact.new(FACT_NAME, fact_value&.empty? ? nil : fact_value)
14
+ end
15
+
16
+ private
17
+
18
+ def azure_hypervisor?
19
+ Facter::Util::Facts::Posix::VirtualDetector.platform == 'hyperv'
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Facts
4
+ module Linux
5
+ module Cloud
6
+ class Provider
7
+ FACT_NAME = 'cloud.provider'
8
+
9
+ def call_the_resolver
10
+ provider = case Facter::Util::Facts::Posix::VirtualDetector.platform
11
+ when 'hyperv'
12
+ 'azure' unless Facter::Resolvers::Az.resolve(:metadata).empty?
13
+ end
14
+
15
+ Facter::ResolvedFact.new(FACT_NAME, provider)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -15,8 +15,8 @@ module Facts
15
15
  private
16
16
 
17
17
  def construct_addresses_hash
18
- primary_dhcp = Facter::Resolvers::NetworkingLinux.resolve(:dhcp)
19
- interfaces = Facter::Resolvers::NetworkingLinux.resolve(:interfaces)
18
+ primary_dhcp = Facter::Resolvers::Linux::Networking.resolve(:dhcp)
19
+ interfaces = Facter::Resolvers::Linux::Networking.resolve(:interfaces)
20
20
  return unless interfaces
21
21
 
22
22
  servers = { system: primary_dhcp }
@@ -5,10 +5,6 @@ module Facts
5
5
  class Ec2Metadata
6
6
  FACT_NAME = 'ec2_metadata'
7
7
 
8
- def initialize
9
- @virtual = Facter::Util::Facts::VirtualDetector.new
10
- end
11
-
12
8
  def call_the_resolver
13
9
  return Facter::ResolvedFact.new(FACT_NAME, nil) unless aws_hypervisors?
14
10
 
@@ -20,7 +16,7 @@ module Facts
20
16
  private
21
17
 
22
18
  def aws_hypervisors?
23
- @virtual.platform =~ /kvm|xen|aws/
19
+ Facter::Util::Facts::Posix::VirtualDetector.platform =~ /kvm|xen|aws/
24
20
  end
25
21
  end
26
22
  end
@@ -5,10 +5,6 @@ module Facts
5
5
  class Ec2Userdata
6
6
  FACT_NAME = 'ec2_userdata'
7
7
 
8
- def initialize
9
- @virtual = Facter::Util::Facts::VirtualDetector.new
10
- end
11
-
12
8
  def call_the_resolver
13
9
  return Facter::ResolvedFact.new(FACT_NAME, nil) unless aws_hypervisors?
14
10
 
@@ -20,7 +16,7 @@ module Facts
20
16
  private
21
17
 
22
18
  def aws_hypervisors?
23
- @virtual.platform =~ /kvm|xen|aws/
19
+ Facter::Util::Facts::Posix::VirtualDetector.platform =~ /kvm|xen|aws/
24
20
  end
25
21
  end
26
22
  end
@@ -28,10 +28,7 @@ module Facts
28
28
  private
29
29
 
30
30
  def xen?
31
- Facter::Resolvers::VirtWhat.resolve(:vm) =~ /xen/ ||
32
- Facter::Resolvers::Xen.resolve(:vm) =~ /xen/ ||
33
- discover_hypervisor == 'xenhvm' ||
34
- Facter::Resolvers::Lspci.resolve(:vm) =~ /xen/
31
+ Facter::Util::Facts::Posix::VirtualDetector.platform =~ /xen/
35
32
  end
36
33
 
37
34
  def hvm?
@@ -7,7 +7,7 @@ module Facts
7
7
  TYPE = :legacy
8
8
 
9
9
  def call_the_resolver
10
- fact_value = Facter::Resolvers::NetworkingLinux.resolve(:interfaces)
10
+ fact_value = Facter::Resolvers::Linux::Networking.resolve(:interfaces)
11
11
 
12
12
  Facter::ResolvedFact.new(FACT_NAME, fact_value && !fact_value.empty? ? fact_value.keys.sort.join(',') : nil,
13
13
  :legacy)
@@ -8,7 +8,7 @@ module Facts
8
8
 
9
9
  def call_the_resolver
10
10
  arr = []
11
- interfaces = Facter::Resolvers::NetworkingLinux.resolve(:interfaces)
11
+ interfaces = Facter::Resolvers::Linux::Networking.resolve(:interfaces)
12
12
  interfaces&.each do |interface_name, info|
13
13
  arr << Facter::ResolvedFact.new("ipaddress6_#{interface_name}", info[:ip6], :legacy) if info[:ip6]
14
14
  end
@@ -8,7 +8,7 @@ module Facts
8
8
 
9
9
  def call_the_resolver
10
10
  arr = []
11
- interfaces = Facter::Resolvers::NetworkingLinux.resolve(:interfaces)
11
+ interfaces = Facter::Resolvers::Linux::Networking.resolve(:interfaces)
12
12
  interfaces&.each do |interface_name, info|
13
13
  arr << Facter::ResolvedFact.new("ipaddress_#{interface_name}", info[:ip], :legacy) if info[:ip]
14
14
  end
@@ -5,12 +5,8 @@ module Facts
5
5
  class IsVirtual
6
6
  FACT_NAME = 'is_virtual'
7
7
 
8
- def initialize
9
- @virtual = Facter::Util::Facts::VirtualDetector.new
10
- end
11
-
12
8
  def call_the_resolver
13
- fact_value = @virtual.platform
9
+ fact_value = Facter::Util::Facts::Posix::VirtualDetector.platform
14
10
 
15
11
  Facter::ResolvedFact.new(FACT_NAME, check_if_virtual(fact_value))
16
12
  end
@@ -8,7 +8,7 @@ module Facts
8
8
 
9
9
  def call_the_resolver
10
10
  arr = []
11
- interfaces = Facter::Resolvers::NetworkingLinux.resolve(:interfaces)
11
+ interfaces = Facter::Resolvers::Linux::Networking.resolve(:interfaces)
12
12
  interfaces&.each do |interface_name, info|
13
13
  arr << Facter::ResolvedFact.new("macaddress_#{interface_name}", info[:mac], :legacy) if info[:mac]
14
14
  end
@@ -8,7 +8,7 @@ module Facts
8
8
 
9
9
  def call_the_resolver
10
10
  arr = []
11
- interfaces = Facter::Resolvers::NetworkingLinux.resolve(:interfaces)
11
+ interfaces = Facter::Resolvers::Linux::Networking.resolve(:interfaces)
12
12
  interfaces&.each do |interface_name, info|
13
13
  arr << Facter::ResolvedFact.new("mtu_#{interface_name}", info[:mtu], :legacy) if info[:mtu]
14
14
  end
@@ -8,7 +8,7 @@ module Facts
8
8
 
9
9
  def call_the_resolver
10
10
  arr = []
11
- interfaces = Facter::Resolvers::NetworkingLinux.resolve(:interfaces)
11
+ interfaces = Facter::Resolvers::Linux::Networking.resolve(:interfaces)
12
12
  interfaces&.each do |interface_name, info|
13
13
  arr << Facter::ResolvedFact.new("netmask6_#{interface_name}", info[:netmask6], :legacy) if info[:netmask6]
14
14
  end
@@ -8,7 +8,7 @@ module Facts
8
8
 
9
9
  def call_the_resolver
10
10
  arr = []
11
- interfaces = Facter::Resolvers::NetworkingLinux.resolve(:interfaces)
11
+ interfaces = Facter::Resolvers::Linux::Networking.resolve(:interfaces)
12
12
  interfaces&.each do |interface_name, info|
13
13
  arr << Facter::ResolvedFact.new("netmask_#{interface_name}", info[:netmask], :legacy) if info[:netmask]
14
14
  end
@@ -8,7 +8,7 @@ module Facts
8
8
 
9
9
  def call_the_resolver
10
10
  arr = []
11
- interfaces = Facter::Resolvers::NetworkingLinux.resolve(:interfaces)
11
+ interfaces = Facter::Resolvers::Linux::Networking.resolve(:interfaces)
12
12
  interfaces&.each do |interface_name, info|
13
13
  arr << Facter::ResolvedFact.new("network6_#{interface_name}", info[:network6], :legacy) if info[:network6]
14
14
  end