facter 4.0.43 → 4.0.44

Sign up to get free protection for your applications and to get access to all the features.
@@ -37,6 +37,8 @@ module Facter
37
37
 
38
38
  output = exec_smbios(param[0])
39
39
  facts = param[1]
40
+ return unless output
41
+
40
42
  facts.each do |name, regx|
41
43
  @fact_list[name] = output.match(/#{regx}/)&.captures&.first
42
44
  end
@@ -9,7 +9,6 @@ module Facter
9
9
  class Networking < BaseResolver
10
10
  @log = Facter::Log.new(self)
11
11
  @fact_list ||= {}
12
- @interfaces = {}
13
12
 
14
13
  class << self
15
14
  private
@@ -5,8 +5,9 @@ module Facter
5
5
  module Solaris
6
6
  class OsRelease < BaseResolver
7
7
  @fact_list ||= {}
8
- @os_version_regex_patterns = ['Solaris \d+ \d+/\d+ s(\d+)[sx]?_u(\d+)wos_',
9
- 'Solaris (\d+)[.](\d+)', 'Solaris (\d+)']
8
+ OS_VERSION_REGEX_PATTERNS = ['Solaris \d+ \d+/\d+ s(\d+)[sx]?_u(\d+)wos_',
9
+ 'Solaris (\d+)[.](\d+)', 'Solaris (\d+)'].freeze
10
+
10
11
  class << self
11
12
  private
12
13
 
@@ -18,7 +19,7 @@ module Facter
18
19
  result = Util::FileHelper.safe_read('/etc/release', nil)
19
20
  return @fact_list[fact_name] = nil if result.nil?
20
21
 
21
- @os_version_regex_patterns.each do |os_version_regex|
22
+ OS_VERSION_REGEX_PATTERNS.each do |os_version_regex|
22
23
  major, minor = search_for_os_version(/#{os_version_regex}/, result)
23
24
  next unless major || minor
24
25
 
@@ -5,8 +5,8 @@ module Facter
5
5
  class SshResolver < BaseResolver
6
6
  @log = Facter::Log.new(self)
7
7
  @fact_list ||= {}
8
- @file_names = %w[ssh_host_rsa_key.pub ssh_host_dsa_key.pub ssh_host_ecdsa_key.pub ssh_host_ed25519_key.pub]
9
- @file_paths = %w[/etc/ssh /usr/local/etc/ssh /etc /usr/local/etc /etc/opt/ssh]
8
+ 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
+ FILE_PATHS = %w[/etc/ssh /usr/local/etc/ssh /etc /usr/local/etc /etc/opt/ssh].freeze
10
10
  class << self
11
11
  private
12
12
 
@@ -16,10 +16,10 @@ module Facter
16
16
 
17
17
  def retrieve_info(fact_name)
18
18
  ssh_list = []
19
- @file_paths.each do |file_path|
19
+ FILE_PATHS.each do |file_path|
20
20
  next unless File.directory?(file_path)
21
21
 
22
- @file_names.each do |file_name|
22
+ FILE_NAMES.each do |file_name|
23
23
  file_content = Util::FileHelper.safe_read(File.join(file_path, file_name), nil)
24
24
  next unless file_content
25
25
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Facter
4
- VERSION = '4.0.43' unless defined?(VERSION)
4
+ VERSION = '4.0.44' unless defined?(VERSION)
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facter
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.43
4
+ version: 4.0.44
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-12 00:00:00.000000000 Z
11
+ date: 2020-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -180,6 +180,7 @@ extra_rdoc_files: []
180
180
  files:
181
181
  - bin/facter
182
182
  - lib/facter.rb
183
+ - lib/facter/config.rb
183
184
  - lib/facter/custom_facts/core/aggregate.rb
184
185
  - lib/facter/custom_facts/core/directed_graph.rb
185
186
  - lib/facter/custom_facts/core/execution.rb
@@ -205,7 +206,6 @@ files:
205
206
  - lib/facter/custom_facts/util/unix_root.rb
206
207
  - lib/facter/custom_facts/util/values.rb
207
208
  - lib/facter/custom_facts/util/windows_root.rb
208
- - lib/facter/fact_groups.conf
209
209
  - lib/facter/facts/aix/aio_agent_version.rb
210
210
  - lib/facter/facts/aix/augeas/version.rb
211
211
  - lib/facter/facts/aix/disks.rb
@@ -854,7 +854,6 @@ files:
854
854
  - lib/facter/models/loaded_fact.rb
855
855
  - lib/facter/models/resolved_fact.rb
856
856
  - lib/facter/models/searched_fact.rb
857
- - lib/facter/os_hierarchy.json
858
857
  - lib/facter/patches/sysfilesystem/sys/statvfs.rb
859
858
  - lib/facter/resolvers/aio_agent_version.rb
860
859
  - lib/facter/resolvers/aix/architecture_resolver.rb
@@ -1,308 +0,0 @@
1
- {
2
- "EC2": [
3
- "ec2_metadata",
4
- "ec2_userdata"
5
- ],
6
- "GCE": [
7
- "gce"
8
- ],
9
- "augeas": [
10
- "augeas",
11
- "augeasversion"
12
- ],
13
- "desktop management interface": [
14
- "dmi",
15
- "bios_vendor",
16
- "bios_version",
17
- "bios_release_date",
18
- "boardassettag",
19
- "boardmanufacturer",
20
- "boardproductname",
21
- "boardserialnumber",
22
- "chassisassettag",
23
- "manufacturer",
24
- "productname",
25
- "serialnumber",
26
- "uuid",
27
- "chassistype"
28
- ],
29
- "file system": [
30
- "mountpoints",
31
- "filesystems",
32
- "partitions"
33
- ],
34
- "hypervisors": [
35
- "hypervisors"
36
- ],
37
- "id": [
38
- "id",
39
- "gid",
40
- "identity"
41
- ],
42
- "kernel": [
43
- "kernel",
44
- "kernelversion",
45
- "kernelrelease",
46
- "kernelmajversion"
47
- ],
48
- "load_average": [
49
- "load_averages"
50
- ],
51
- "memory": [
52
- "memory",
53
- "memoryfree",
54
- "memoryfree_mb",
55
- "memorysize",
56
- "memorysize_mb",
57
- "swapfree",
58
- "swapfree_mb",
59
- "swapsize",
60
- "swapsize_mb",
61
- "swapencrypted"
62
- ],
63
- "networking": [
64
- "networking",
65
- "hostname",
66
- "ipaddress",
67
- "ipaddress6",
68
- "netmask",
69
- "netmask6",
70
- "network",
71
- "network6",
72
- "macaddress",
73
- "interfaces",
74
- "domain",
75
- "fqdn",
76
- "dhcp_servers"
77
- ],
78
- "operating system": [
79
- "os",
80
- "operatingsystem",
81
- "osfamily",
82
- "operatingsystemrelease",
83
- "operatingsystemmajrelease",
84
- "hardwaremodel",
85
- "architecture",
86
- "lsbdistid",
87
- "lsbdistrelease",
88
- "lsbdistcodename",
89
- "lsbdistdescription",
90
- "lsbmajdistrelease",
91
- "lsbminordistrelease",
92
- "lsbrelease",
93
- "macosx_buildversion",
94
- "macosx_productname",
95
- "macosx_productversion",
96
- "macosx_productversion_major",
97
- "macosx_productversion_minor",
98
- "windows_edition_id",
99
- "windows_installation_type",
100
- "windows_product_name",
101
- "windows_release_id",
102
- "system32",
103
- "selinux",
104
- "selinux_enforced",
105
- "selinux_policyversion",
106
- "selinux_current_mode",
107
- "selinux_config_mode",
108
- "selinux_config_policy"
109
- ],
110
- "path": [
111
- "path"
112
- ],
113
- "processor": [
114
- "processors",
115
- "processorcount",
116
- "physicalprocessorcount",
117
- "hardwareisa"
118
- ],
119
- "ssh": [
120
- "ssh",
121
- "sshdsakey",
122
- "sshrsakey",
123
- "sshecdsakey",
124
- "sshed25519key",
125
- "sshfp_dsa",
126
- "sshfp_rsa",
127
- "sshfp_ecdsa",
128
- "sshfp_ed25519"
129
- ],
130
- "system profiler": [
131
- "system_profiler",
132
- "sp_boot_mode",
133
- "sp_boot_rom_version",
134
- "sp_boot_volume",
135
- "sp_cpu_type",
136
- "sp_current_processor_speed",
137
- "sp_kernel_version",
138
- "sp_l2_cache_core",
139
- "sp_l3_cache",
140
- "sp_local_host_name",
141
- "sp_machine_model",
142
- "sp_machine_name",
143
- "sp_number_processors",
144
- "sp_os_version",
145
- "sp_packages",
146
- "sp_physical_memory",
147
- "sp_platform_uuid",
148
- "sp_secure_vm",
149
- "sp_serial_number",
150
- "sp_smc_version_system",
151
- "sp_uptime",
152
- "sp_user_name"
153
- ],
154
- "timezone": [
155
- "timezone"
156
- ],
157
- "uptime": [
158
- "system_uptime",
159
- "uptime",
160
- "uptime_days",
161
- "uptime_hours",
162
- "uptime_seconds"
163
- ],
164
- "virtualization": [
165
- "virtual",
166
- "is_virtual",
167
- "cloud"
168
- ],
169
- "legacy": [
170
- "architecture",
171
- "augeasversion",
172
- "bios_release_date",
173
- "bios_vendor",
174
- "bios_version",
175
- "blockdevice_*_model",
176
- "blockdevice_*_size",
177
- "blockdevice_*_vendor",
178
- "blockdevices",
179
- "boardassettag",
180
- "boardmanufacturer",
181
- "boardproductname",
182
- "boardserialnumber",
183
- "chassisassettag",
184
- "chassistype",
185
- "dhcp_servers",
186
- "domain",
187
- "fqdn",
188
- "gid",
189
- "hardwareisa",
190
- "hardwaremodel",
191
- "hostname",
192
- "id",
193
- "interfaces",
194
- "ipaddress",
195
- "ipaddress_.*",
196
- "ipaddress_*",
197
- "ipaddress6",
198
- "ipaddress6_.*",
199
- "ipaddress6_*",
200
- "ldom_*",
201
- "lsbdistcodename",
202
- "lsbdistdescription",
203
- "lsbdistid",
204
- "lsbdistrelease",
205
- "lsbmajdistrelease",
206
- "lsbminordistrelease",
207
- "lsbrelease",
208
- "macaddress",
209
- "macaddress_.*",
210
- "macaddress_*",
211
- "macosx_buildversion",
212
- "macosx_productname",
213
- "macosx_productversion",
214
- "macosx_productversion_major",
215
- "macosx_productversion_minor",
216
- "manufacturer",
217
- "memoryfree",
218
- "memoryfree_mb",
219
- "memorysize",
220
- "memorysize_mb",
221
- "mtu_.*",
222
- "mtu_*",
223
- "netmask",
224
- "netmask_.*",
225
- "netmask_*",
226
- "netmask6",
227
- "netmask6_.*",
228
- "netmask6_*",
229
- "network",
230
- "network_.*",
231
- "network_*",
232
- "network6",
233
- "network6_.*",
234
- "network6_*",
235
- "operatingsystem",
236
- "operatingsystemmajrelease",
237
- "operatingsystemrelease",
238
- "osfamily",
239
- "physicalprocessorcount",
240
- "processor.*",
241
- "processor*",
242
- "processorcount",
243
- "productname",
244
- "rubyplatform",
245
- "rubysitedir",
246
- "rubyversion",
247
- "scope6",
248
- "scope6_.*",
249
- "selinux",
250
- "selinux_config_mode",
251
- "selinux_config_policy",
252
- "selinux_current_mode",
253
- "selinux_enforced",
254
- "selinux_policyversion",
255
- "serialnumber",
256
- "sp_*",
257
- "sp_boot_mode",
258
- "sp_boot_rom_version",
259
- "sp_boot_volume",
260
- "sp_cpu_type",
261
- "sp_current_processor_speed",
262
- "sp_kernel_version",
263
- "sp_l2_cache_core",
264
- "sp_l3_cache",
265
- "sp_local_host_name",
266
- "sp_machine_model",
267
- "sp_machine_name",
268
- "sp_number_processors",
269
- "sp_os_version",
270
- "sp_packages",
271
- "sp_physical_memory",
272
- "sp_platform_uuid",
273
- "sp_secure_vm",
274
- "sp_serial_number",
275
- "sp_smc_version_system",
276
- "sp_uptime",
277
- "sp_user_name",
278
- "ssh.*key",
279
- "ssh*key",
280
- "sshfp_.*",
281
- "sshfp_*",
282
- "swapencrypted",
283
- "swapfree",
284
- "swapfree_mb",
285
- "swapsize",
286
- "swapsize_mb",
287
- "system32",
288
- "uptime",
289
- "uptime_days",
290
- "uptime_hours",
291
- "uptime_seconds",
292
- "uuid",
293
- "windows_edition_id",
294
- "windows_installation_type",
295
- "windows_product_name",
296
- "windows_release_id",
297
- "xendomains",
298
- "zone_*_brand",
299
- "zone_*_id",
300
- "zone_*_iptype",
301
- "zone_*_name",
302
- "zone_*_path",
303
- "zone_*_status",
304
- "zone_*_uuid",
305
- "zonename",
306
- "zones"
307
- ]
308
- }
@@ -1,36 +0,0 @@
1
- [
2
- {
3
- "Linux": [
4
- {
5
- "Debian": [
6
- "Elementary",
7
- "Ubuntu",
8
- "Raspbian"
9
- ]
10
- },
11
- {
12
- "Rhel": [
13
- "Fedora",
14
- "Amzn",
15
- "Centos",
16
- "Ol",
17
- "Scientific"
18
- ]
19
- },
20
- {
21
- "Sles": [
22
- "Opensuse"
23
- ]
24
- }
25
- ]
26
- },
27
- {
28
- "Bsd": [
29
- "Freebsd"
30
- ]
31
- },
32
- "Solaris",
33
- "Macosx",
34
- "Windows",
35
- "Aix"
36
- ]