facter 4.0.44 → 4.0.46

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/lib/facter.rb +15 -1
  3. data/lib/facter/config.rb +1 -0
  4. data/lib/facter/custom_facts/core/execution.rb +28 -4
  5. data/lib/facter/custom_facts/core/execution/base.rb +33 -33
  6. data/lib/facter/custom_facts/util/parser.rb +17 -3
  7. data/lib/facter/facts/solaris/hypervisors/ldom.rb +3 -0
  8. data/lib/facter/facts/solaris/ldom.rb +4 -1
  9. data/lib/facter/framework/cli/cli.rb +19 -5
  10. data/lib/facter/framework/config/fact_groups.rb +5 -3
  11. data/lib/facter/framework/core/cache_manager.rb +57 -15
  12. data/lib/facter/framework/core/fact/internal/core_fact.rb +6 -1
  13. data/lib/facter/framework/core/fact/internal/internal_fact_manager.rb +38 -4
  14. data/lib/facter/framework/core/fact_augmenter.rb +1 -1
  15. data/lib/facter/framework/core/fact_loaders/fact_loader.rb +1 -1
  16. data/lib/facter/framework/core/fact_manager.rb +1 -1
  17. data/lib/facter/framework/core/options/config_file_options.rb +16 -5
  18. data/lib/facter/framework/core/options/option_store.rb +7 -3
  19. data/lib/facter/resolvers/aio_agent_version.rb +1 -1
  20. data/lib/facter/resolvers/aix/architecture_resolver.rb +2 -1
  21. data/lib/facter/resolvers/aix/disks.rb +2 -1
  22. data/lib/facter/resolvers/aix/filesystem_resolver.rb +1 -1
  23. data/lib/facter/resolvers/aix/hardware_resolver.rb +2 -1
  24. data/lib/facter/resolvers/aix/load_averages_resolver.rb +2 -1
  25. data/lib/facter/resolvers/aix/memory.rb +2 -1
  26. data/lib/facter/resolvers/aix/mountpoints.rb +2 -1
  27. data/lib/facter/resolvers/aix/networking_resolver.rb +1 -1
  28. data/lib/facter/resolvers/aix/nim.rb +1 -1
  29. data/lib/facter/resolvers/aix/os_level.rb +1 -1
  30. data/lib/facter/resolvers/aix/partitions.rb +2 -1
  31. data/lib/facter/resolvers/aix/processors.rb +2 -1
  32. data/lib/facter/resolvers/aix/serialnumber.rb +1 -1
  33. data/lib/facter/resolvers/augeas_resolver.rb +1 -1
  34. data/lib/facter/resolvers/base_resolver.rb +11 -4
  35. data/lib/facter/resolvers/bsd/processors.rb +2 -1
  36. data/lib/facter/resolvers/cloud.rb +1 -1
  37. data/lib/facter/resolvers/containers.rb +2 -1
  38. data/lib/facter/resolvers/debian_version.rb +1 -1
  39. data/lib/facter/resolvers/disk_resolver.rb +4 -1
  40. data/lib/facter/resolvers/dmi_decode.rb +1 -1
  41. data/lib/facter/resolvers/dmi_resolver.rb +2 -1
  42. data/lib/facter/resolvers/ec2.rb +2 -1
  43. data/lib/facter/resolvers/eos_release_resolver.rb +1 -1
  44. data/lib/facter/resolvers/facterversion_resolver.rb +1 -1
  45. data/lib/facter/resolvers/filesystems_resolver.rb +4 -1
  46. data/lib/facter/resolvers/fips_enabled_resolver.rb +4 -1
  47. data/lib/facter/resolvers/freebsd/dmi_resolver.rb +1 -1
  48. data/lib/facter/resolvers/freebsd/freebsd_version_resolver.rb +9 -7
  49. data/lib/facter/resolvers/freebsd/geom_resolver.rb +2 -1
  50. data/lib/facter/resolvers/freebsd/processors.rb +2 -1
  51. data/lib/facter/resolvers/freebsd/swap_memory_resolver.rb +2 -1
  52. data/lib/facter/resolvers/freebsd/system_memory_resolver.rb +2 -1
  53. data/lib/facter/resolvers/gce.rb +2 -1
  54. data/lib/facter/resolvers/hostname_resolver.rb +2 -1
  55. data/lib/facter/resolvers/identity_resolver.rb +2 -1
  56. data/lib/facter/resolvers/linux/docker_uptime.rb +2 -1
  57. data/lib/facter/resolvers/linux/load_averages.rb +2 -1
  58. data/lib/facter/resolvers/load_averages.rb +2 -1
  59. data/lib/facter/resolvers/lpar_resolver.rb +1 -1
  60. data/lib/facter/resolvers/lsb_release_resolver.rb +1 -1
  61. data/lib/facter/resolvers/lspci.rb +1 -1
  62. data/lib/facter/resolvers/macosx/dmi_resolver.rb +1 -1
  63. data/lib/facter/resolvers/macosx/filesystems_resolver.rb +1 -1
  64. data/lib/facter/resolvers/macosx/load_averages_resolver.rb +2 -1
  65. data/lib/facter/resolvers/macosx/mountpoints_resolver.rb +2 -1
  66. data/lib/facter/resolvers/macosx/processor_resolver.rb +2 -1
  67. data/lib/facter/resolvers/macosx/swap_memory_resolver.rb +2 -1
  68. data/lib/facter/resolvers/macosx/system_memory_resolver.rb +2 -1
  69. data/lib/facter/resolvers/macosx/system_profiler_resolver.rb +1 -3
  70. data/lib/facter/resolvers/memory_resolver.rb +3 -1
  71. data/lib/facter/resolvers/mountpoints_resolver.rb +4 -1
  72. data/lib/facter/resolvers/networking_linux_resolver.rb +5 -4
  73. data/lib/facter/resolvers/networking_resolver.rb +1 -1
  74. data/lib/facter/resolvers/open_vz.rb +1 -1
  75. data/lib/facter/resolvers/os_release_resolver.rb +1 -1
  76. data/lib/facter/resolvers/partitions.rb +2 -1
  77. data/lib/facter/resolvers/path_resolver.rb +1 -1
  78. data/lib/facter/resolvers/processors_resolver.rb +4 -1
  79. data/lib/facter/resolvers/puppet_version_resolver.rb +1 -1
  80. data/lib/facter/resolvers/redhat_release_resolver.rb +1 -1
  81. data/lib/facter/resolvers/ruby_resolver.rb +1 -1
  82. data/lib/facter/resolvers/selinux_resolver.rb +1 -1
  83. data/lib/facter/resolvers/solaris/disks.rb +1 -1
  84. data/lib/facter/resolvers/solaris/dmi.rb +1 -1
  85. data/lib/facter/resolvers/solaris/dmi_sparc.rb +1 -1
  86. data/lib/facter/resolvers/solaris/filesystems.rb +1 -1
  87. data/lib/facter/resolvers/solaris/ipaddress.rb +2 -1
  88. data/lib/facter/resolvers/solaris/ldom.rb +1 -3
  89. data/lib/facter/resolvers/solaris/memory.rb +2 -1
  90. data/lib/facter/resolvers/solaris/mountpoints.rb +2 -2
  91. data/lib/facter/resolvers/solaris/networking.rb +1 -1
  92. data/lib/facter/resolvers/solaris/os_release.rb +2 -1
  93. data/lib/facter/resolvers/solaris/processors.rb +2 -1
  94. data/lib/facter/resolvers/solaris/zone.rb +1 -1
  95. data/lib/facter/resolvers/solaris/zone_name.rb +1 -1
  96. data/lib/facter/resolvers/ssh_resolver.rb +4 -1
  97. data/lib/facter/resolvers/suse_release_resolver.rb +1 -1
  98. data/lib/facter/resolvers/sw_vers_resolver.rb +2 -2
  99. data/lib/facter/resolvers/timezone_resolver.rb +1 -1
  100. data/lib/facter/resolvers/uname_resolver.rb +1 -1
  101. data/lib/facter/resolvers/uptime_resolver.rb +1 -1
  102. data/lib/facter/resolvers/utils/networking.rb +2 -0
  103. data/lib/facter/resolvers/virt_what.rb +1 -1
  104. data/lib/facter/resolvers/vmware.rb +1 -1
  105. data/lib/facter/resolvers/windows/aio_agent_version.rb +1 -1
  106. data/lib/facter/resolvers/windows/dmi_bios_resolver.rb +1 -1
  107. data/lib/facter/resolvers/windows/dmi_computersystem_resolver.rb +1 -1
  108. data/lib/facter/resolvers/windows/fips_resolver.rb +2 -1
  109. data/lib/facter/resolvers/windows/hardware_architecture_resolver.rb +2 -1
  110. data/lib/facter/resolvers/windows/identity_resolver.rb +2 -1
  111. data/lib/facter/resolvers/windows/kernel_resolver.rb +3 -1
  112. data/lib/facter/resolvers/windows/memory_resolver.rb +3 -1
  113. data/lib/facter/resolvers/windows/netkvm_resolver.rb +2 -1
  114. data/lib/facter/resolvers/windows/networking_resolver.rb +2 -1
  115. data/lib/facter/resolvers/windows/processors_resolver.rb +2 -1
  116. data/lib/facter/resolvers/windows/product_release_resolver.rb +2 -1
  117. data/lib/facter/resolvers/windows/ssh.rb +3 -1
  118. data/lib/facter/resolvers/windows/system32_resolver.rb +3 -1
  119. data/lib/facter/resolvers/windows/uptime_resolver.rb +2 -1
  120. data/lib/facter/resolvers/windows/virtualization_resolver.rb +2 -1
  121. data/lib/facter/resolvers/windows/win_os_description_resolver.rb +3 -1
  122. data/lib/facter/resolvers/wpar_resolver.rb +1 -1
  123. data/lib/facter/resolvers/xen.rb +1 -1
  124. data/lib/facter/resolvers/zfs.rb +2 -1
  125. data/lib/facter/resolvers/zpool.rb +2 -1
  126. data/lib/facter/version.rb +1 -1
  127. metadata +4 -3
@@ -3,7 +3,8 @@
3
3
  module Facter
4
4
  module Resolvers
5
5
  class Partitions < BaseResolver
6
- @fact_list ||= {}
6
+ init_resolver
7
+
7
8
  BLOCK_PATH = '/sys/block'
8
9
  BLOCK_SIZE = 512
9
10
 
@@ -3,7 +3,7 @@
3
3
  module Facter
4
4
  module Resolvers
5
5
  class Path < BaseResolver
6
- @fact_list ||= {}
6
+ init_resolver
7
7
 
8
8
  class << self
9
9
  private
@@ -5,8 +5,11 @@ module Facter
5
5
  module Linux
6
6
  class Processors < BaseResolver
7
7
  @log = Facter::Log.new(self)
8
- @fact_list ||= {}
8
+
9
+ init_resolver
10
+
9
11
  MHZ_TO_HZ = 1_000_000
12
+
10
13
  class << self
11
14
  # :count
12
15
  # :models
@@ -5,7 +5,7 @@ module Facter
5
5
  class PuppetVersionResolver < BaseResolver
6
6
  # :puppetversion
7
7
 
8
- @fact_list ||= {}
8
+ init_resolver
9
9
 
10
10
  class << self
11
11
  private
@@ -7,7 +7,7 @@ module Facter
7
7
  # :version
8
8
  # :codename
9
9
 
10
- @fact_list ||= {}
10
+ init_resolver
11
11
 
12
12
  class << self
13
13
  private
@@ -3,7 +3,7 @@
3
3
  module Facter
4
4
  module Resolvers
5
5
  class Ruby < BaseResolver
6
- @fact_list ||= {}
6
+ init_resolver
7
7
 
8
8
  class << self
9
9
  private
@@ -3,7 +3,7 @@
3
3
  module Facter
4
4
  module Resolvers
5
5
  class SELinux < BaseResolver
6
- @fact_list ||= {}
6
+ init_resolver
7
7
 
8
8
  class << self
9
9
  private
@@ -4,7 +4,7 @@ module Facter
4
4
  module Resolvers
5
5
  module Solaris
6
6
  class Disks < BaseResolver
7
- @fact_list ||= {}
7
+ init_resolver
8
8
 
9
9
  class << self
10
10
  private
@@ -4,7 +4,7 @@ module Facter
4
4
  module Resolvers
5
5
  module Solaris
6
6
  class Dmi < BaseResolver
7
- @fact_list ||= {}
7
+ init_resolver
8
8
 
9
9
  class << self
10
10
  private
@@ -4,7 +4,7 @@ module Facter
4
4
  module Resolvers
5
5
  module Solaris
6
6
  class DmiSparc < BaseResolver
7
- @fact_list ||= {}
7
+ init_resolver
8
8
 
9
9
  class << self
10
10
  private
@@ -4,7 +4,7 @@ module Facter
4
4
  module Resolvers
5
5
  module Solaris
6
6
  class Filesystem < BaseResolver
7
- @fact_list ||= {}
7
+ init_resolver
8
8
 
9
9
  class << self
10
10
  private
@@ -4,7 +4,8 @@ module Facter
4
4
  module Resolvers
5
5
  module Solaris
6
6
  class Ipaddress < BaseResolver
7
- @fact_list ||= {}
7
+ init_resolver
8
+
8
9
  class << self
9
10
  private
10
11
 
@@ -14,7 +14,7 @@ module Facter
14
14
  # :role_service
15
15
  # :role_impl
16
16
 
17
- @fact_list ||= {}
17
+ init_resolver
18
18
 
19
19
  VIRTINFO_MAPPING = {
20
20
  chassis_serial: %w[DOMAINCHASSIS serialno],
@@ -36,8 +36,6 @@ module Facter
36
36
  end
37
37
 
38
38
  def call_virtinfo(fact_name)
39
- # return unless File.executable?('/usr/sbin/virtinfo')
40
-
41
39
  virtinfo_output = Facter::Core::Execution.execute('/usr/sbin/virtinfo -a -p', logger: log)
42
40
  return if virtinfo_output.empty?
43
41
 
@@ -4,10 +4,11 @@ module Facter
4
4
  module Resolvers
5
5
  module Solaris
6
6
  class Memory < BaseResolver
7
+ init_resolver
7
8
  BLOCKSIZE = 512
8
9
  # :system
9
10
  # :swap
10
- @fact_list ||= {}
11
+
11
12
  class << self
12
13
  private
13
14
 
@@ -5,8 +5,8 @@ module Facter
5
5
  module Solaris
6
6
  class Mountpoints < BaseResolver
7
7
  include Facter::FilesystemHelper
8
- @fact_list ||= {}
9
- @log = Facter::Log.new(self)
8
+ init_resolver
9
+
10
10
  class << self
11
11
  private
12
12
 
@@ -7,8 +7,8 @@ module Facter
7
7
  module Resolvers
8
8
  module Solaris
9
9
  class Networking < BaseResolver
10
+ init_resolver
10
11
  @log = Facter::Log.new(self)
11
- @fact_list ||= {}
12
12
 
13
13
  class << self
14
14
  private
@@ -4,7 +4,8 @@ module Facter
4
4
  module Resolvers
5
5
  module Solaris
6
6
  class OsRelease < BaseResolver
7
- @fact_list ||= {}
7
+ init_resolver
8
+
8
9
  OS_VERSION_REGEX_PATTERNS = ['Solaris \d+ \d+/\d+ s(\d+)[sx]?_u(\d+)wos_',
9
10
  'Solaris (\d+)[.](\d+)', 'Solaris (\d+)'].freeze
10
11
 
@@ -4,7 +4,8 @@ module Facter
4
4
  module Resolvers
5
5
  module Solaris
6
6
  class Processors < BaseResolver
7
- @fact_list ||= {}
7
+ init_resolver
8
+
8
9
  class << self
9
10
  private
10
11
 
@@ -4,7 +4,7 @@ module Facter
4
4
  module Resolvers
5
5
  module Solaris
6
6
  class Zone < BaseResolver
7
- @fact_list ||= {}
7
+ init_resolver
8
8
 
9
9
  class << self
10
10
  private
@@ -4,7 +4,7 @@ module Facter
4
4
  module Resolvers
5
5
  module Solaris
6
6
  class ZoneName < BaseResolver
7
- @fact_list ||= {}
7
+ init_resolver
8
8
 
9
9
  class << self
10
10
  private
@@ -4,9 +4,12 @@ module Facter
4
4
  module Resolvers
5
5
  class SshResolver < BaseResolver
6
6
  @log = Facter::Log.new(self)
7
- @fact_list ||= {}
7
+
8
+ init_resolver
9
+
8
10
  FILE_NAMES = %w[ssh_host_rsa_key.pub ssh_host_dsa_key.pub ssh_host_ecdsa_key.pub ssh_host_ed25519_key.pub].freeze
9
11
  FILE_PATHS = %w[/etc/ssh /usr/local/etc/ssh /etc /usr/local/etc /etc/opt/ssh].freeze
12
+
10
13
  class << self
11
14
  private
12
15
 
@@ -7,7 +7,7 @@ module Facter
7
7
  # :version
8
8
  # :codename
9
9
 
10
- @fact_list ||= {}
10
+ init_resolver
11
11
 
12
12
  class << self
13
13
  private
@@ -6,8 +6,8 @@ module Facter
6
6
  # :productname
7
7
  # :productversion
8
8
  # :buildversion
9
- #
10
- @fact_list ||= {}
9
+
10
+ init_resolver
11
11
 
12
12
  class << self
13
13
  private
@@ -3,7 +3,7 @@
3
3
  module Facter
4
4
  module Resolvers
5
5
  class Timezone < BaseResolver
6
- @fact_list ||= {}
6
+ init_resolver
7
7
 
8
8
  class << self
9
9
  private
@@ -3,7 +3,7 @@
3
3
  module Facter
4
4
  module Resolvers
5
5
  class Uname < BaseResolver
6
- @fact_list ||= {}
6
+ init_resolver
7
7
 
8
8
  class << self
9
9
  private
@@ -3,7 +3,7 @@
3
3
  module Facter
4
4
  module Resolvers
5
5
  class Uptime < BaseResolver
6
- @fact_list ||= {}
6
+ init_resolver
7
7
 
8
8
  class << self
9
9
  private
@@ -12,6 +12,8 @@ module Resolvers
12
12
  #
13
13
  # @return [Hash] Hash containing ip address, netmask and network
14
14
  def build_binding(addr, mask_length)
15
+ return if !addr || !mask_length
16
+
15
17
  ip = IPAddr.new(addr)
16
18
  mask_helper = ip.ipv6? ? 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff' : '255.255.255.255'
17
19
  mask = IPAddr.new(mask_helper).mask(mask_length)
@@ -3,7 +3,7 @@
3
3
  module Facter
4
4
  module Resolvers
5
5
  class VirtWhat < BaseResolver
6
- @fact_list ||= {}
6
+ init_resolver
7
7
 
8
8
  class << self
9
9
  private
@@ -3,7 +3,7 @@
3
3
  module Facter
4
4
  module Resolvers
5
5
  class Vmware < BaseResolver
6
- @fact_list ||= {}
6
+ init_resolver
7
7
 
8
8
  class << self
9
9
  private
@@ -5,7 +5,7 @@ module Facter
5
5
  module Windows
6
6
  class AioAgentVersion < BaseResolver
7
7
  REGISTRY_PATH = 'SOFTWARE\\Puppet Labs\\Puppet'
8
- @fact_list ||= {}
8
+ init_resolver
9
9
 
10
10
  class << self
11
11
  private
@@ -4,7 +4,7 @@ module Facter
4
4
  module Resolvers
5
5
  class DMIBios < BaseResolver
6
6
  @log = Facter::Log.new(self)
7
- @fact_list ||= {}
7
+ init_resolver
8
8
 
9
9
  class << self
10
10
  # Manufacturer
@@ -4,7 +4,7 @@ module Facter
4
4
  module Resolvers
5
5
  class DMIComputerSystem < BaseResolver
6
6
  @log = Facter::Log.new(self)
7
- @fact_list ||= {}
7
+ init_resolver
8
8
 
9
9
  class << self
10
10
  # Name
@@ -7,7 +7,8 @@ module Facter
7
7
  module Windows
8
8
  class Fips < BaseResolver
9
9
  # :fips_enabled
10
- @fact_list ||= {}
10
+ init_resolver
11
+
11
12
  class << self
12
13
  private
13
14
 
@@ -3,7 +3,8 @@
3
3
  module Facter
4
4
  module Resolvers
5
5
  class HardwareArchitecture < BaseResolver
6
- @fact_list ||= {}
6
+ init_resolver
7
+
7
8
  class << self
8
9
  private
9
10
 
@@ -5,7 +5,8 @@ module Facter
5
5
  class Identity < BaseResolver
6
6
  NAME_SAM_COMPATIBLE = 2
7
7
  @log = Facter::Log.new(self)
8
- @fact_list ||= {}
8
+
9
+ init_resolver
9
10
 
10
11
  class << self
11
12
  private
@@ -4,7 +4,9 @@ module Facter
4
4
  module Resolvers
5
5
  class Kernel < BaseResolver
6
6
  @log = Facter::Log.new(self)
7
- @fact_list ||= {}
7
+
8
+ init_resolver
9
+
8
10
  class << self
9
11
  private
10
12
 
@@ -4,7 +4,9 @@ module Facter
4
4
  module Resolvers
5
5
  class Memory < BaseResolver
6
6
  @log = Facter::Log.new(self)
7
- @fact_list ||= {}
7
+
8
+ init_resolver
9
+
8
10
  class << self
9
11
  private
10
12
 
@@ -5,7 +5,8 @@ require 'win32/registry'
5
5
  module Facter
6
6
  module Resolvers
7
7
  class NetKVM < BaseResolver
8
- @fact_list ||= {}
8
+ init_resolver
9
+
9
10
  class << self
10
11
  private
11
12
 
@@ -5,7 +5,8 @@ module Facter
5
5
  module Windows
6
6
  class Networking < BaseResolver
7
7
  @log = Facter::Log.new(self)
8
- @fact_list ||= {}
8
+ init_resolver
9
+
9
10
  class << self
10
11
  private
11
12
 
@@ -3,7 +3,8 @@
3
3
  module Facter
4
4
  module Resolvers
5
5
  class Processors < BaseResolver
6
- @fact_list = {}
6
+ init_resolver
7
+
7
8
  class << self
8
9
  # Count
9
10
  # Isa
@@ -5,7 +5,8 @@ require 'win32/registry'
5
5
  module Facter
6
6
  module Resolvers
7
7
  class ProductRelease < BaseResolver
8
- @fact_list ||= {}
8
+ init_resolver
9
+
9
10
  class << self
10
11
  private
11
12