facter 4.2.8 → 4.2.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/facter/facts/linux/cloud/provider.rb +2 -0
- data/lib/facter/facts/windows/cloud/provider.rb +2 -0
- data/lib/facter/framework/core/cache_manager.rb +1 -1
- data/lib/facter/resolvers/virt_what.rb +3 -1
- data/lib/facter/resolvers/windows/ffi/ffi.rb +13 -6
- data/lib/facter/resolvers/windows/networking.rb +3 -4
- data/lib/facter/util/facts/windows_release_finder.rb +5 -3
- data/lib/facter/util/file_helper.rb +2 -2
- data/lib/facter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b94d35e70448fb5efde799119e0bcfe508e4097133b44939c453fcbd0f39983a
|
4
|
+
data.tar.gz: 6f97201f2619f853c2a66ff15cb4538b67dc3d843ff48629ca65d7b0bfc626d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ad5f88e1d7e8517c6cae2687fbf74a05ebcd2a92e54baef7276b08d6e0bee0e4af77e4f908951acf2e956d9e9ff9ced4773fff260639e2e1db3b230da75700a
|
7
|
+
data.tar.gz: 6a3e65102fd483807f3d67fa17eda71f7cdce61f59cc7e512c81990d9b02a29389c2c582ae3ccf187d3450918c28f9efc0a7a50c31314950f4109d3492e9c21d
|
@@ -12,6 +12,8 @@ module Facts
|
|
12
12
|
'azure' unless Facter::Resolvers::Az.resolve(:metadata).empty?
|
13
13
|
when 'kvm', 'xen'
|
14
14
|
'aws' unless Facter::Resolvers::Ec2.resolve(:metadata).empty?
|
15
|
+
when 'gce'
|
16
|
+
'gce' unless Facter::Resolvers::Gce.resolve(:metadata).empty?
|
15
17
|
end
|
16
18
|
|
17
19
|
Facter::ResolvedFact.new(FACT_NAME, provider)
|
@@ -13,6 +13,8 @@ module Facts
|
|
13
13
|
'azure' unless Facter::Resolvers::Az.resolve(:metadata).empty?
|
14
14
|
when 'kvm', 'xen'
|
15
15
|
'aws' unless Facter::Resolvers::Ec2.resolve(:metadata).empty?
|
16
|
+
when 'gce'
|
17
|
+
'gce' unless Facter::Resolvers::Gce.resolve(:metadata).empty?
|
16
18
|
end
|
17
19
|
|
18
20
|
Facter::ResolvedFact.new(FACT_NAME, provider)
|
@@ -227,7 +227,7 @@ cache_format_version is incorrect!")
|
|
227
227
|
|
228
228
|
begin
|
229
229
|
File.delete(cache_file_name) if File.readable?(cache_file_name)
|
230
|
-
rescue Errno::EACCES => e
|
230
|
+
rescue Errno::EACCES, Errno::EROFS => e
|
231
231
|
@log.warn("Could not delete cache: #{e.message}")
|
232
232
|
end
|
233
233
|
end
|
@@ -34,11 +34,13 @@ module Facter
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def determine_other(output)
|
37
|
-
|
37
|
+
values = output.split("\n")
|
38
|
+
other_vm = values.first
|
38
39
|
return unless other_vm
|
39
40
|
|
40
41
|
return 'zlinux' if other_vm =~ /ibm_systemz/
|
41
42
|
return retrieve_vserver if other_vm =~ /linux_vserver/
|
43
|
+
return (values - ['redhat']).first if values.include?('redhat')
|
42
44
|
|
43
45
|
other_vm
|
44
46
|
end
|
@@ -24,26 +24,33 @@ MAX_PATH = 32_767
|
|
24
24
|
|
25
25
|
module FFI
|
26
26
|
WIN32FALSE = 0
|
27
|
-
END_OF_WCHAR_STRING = "\0\0".
|
27
|
+
END_OF_WCHAR_STRING = (+"\0\0").force_encoding(Encoding::UTF_16LE).freeze
|
28
28
|
|
29
29
|
class Pointer
|
30
30
|
def read_wide_string_with_length(char_length)
|
31
31
|
# char_length is number of wide chars (typically excluding NULLs), *not* bytes
|
32
|
-
str = get_bytes(0, char_length * 2).force_encoding(
|
33
|
-
str.encode(
|
32
|
+
str = get_bytes(0, char_length * 2).force_encoding(Encoding::UTF_16LE)
|
33
|
+
str.encode(Encoding::UTF_8, str.encoding)
|
34
34
|
end
|
35
35
|
|
36
|
-
def read_wide_string_without_length
|
36
|
+
def read_wide_string_without_length(replace_invalid_chars: false)
|
37
37
|
wide_character = get_bytes(0, 2)
|
38
|
+
wide_character.force_encoding(Encoding::UTF_16LE)
|
38
39
|
i = 2
|
39
40
|
str = []
|
40
41
|
|
41
|
-
while wide_character
|
42
|
+
while wide_character != END_OF_WCHAR_STRING
|
42
43
|
str << wide_character
|
43
44
|
wide_character = get_bytes(i, 2)
|
45
|
+
wide_character.force_encoding(Encoding::UTF_16LE)
|
44
46
|
i += 2
|
45
47
|
end
|
46
|
-
|
48
|
+
|
49
|
+
if replace_invalid_chars
|
50
|
+
str.join.force_encoding(Encoding::UTF_16LE).encode(Encoding::UTF_8, Encoding::UTF_16LE, invalid: :replace)
|
51
|
+
else
|
52
|
+
str.join.force_encoding(Encoding::UTF_16LE).encode(Encoding::UTF_8)
|
53
|
+
end
|
47
54
|
end
|
48
55
|
|
49
56
|
def read_win32_bool
|
@@ -71,12 +71,11 @@ module Facter
|
|
71
71
|
adapter_address = IpAdapterAddressesLh.new(adapter_address[:Next])
|
72
72
|
next
|
73
73
|
end
|
74
|
-
|
75
74
|
if !@fact_list[:domain] || @fact_list[:domain].empty?
|
76
|
-
@fact_list[:domain] = adapter_address[:DnsSuffix]
|
75
|
+
@fact_list[:domain] = adapter_address[:DnsSuffix]
|
76
|
+
.read_wide_string_without_length(replace_invalid_chars: true)
|
77
77
|
end
|
78
|
-
|
79
|
-
name = adapter_address[:FriendlyName].read_wide_string_without_length
|
78
|
+
name = adapter_address[:FriendlyName].read_wide_string_without_length(replace_invalid_chars: true)
|
80
79
|
net_interface[name] = build_interface_info(adapter_address, name)
|
81
80
|
end
|
82
81
|
|
@@ -14,7 +14,7 @@ module Facter
|
|
14
14
|
kernel_version = input[:kernel_version]
|
15
15
|
|
16
16
|
if version =~ /10.0/
|
17
|
-
|
17
|
+
check_version_10_11(consumerrel, kernel_version)
|
18
18
|
else
|
19
19
|
check_version_6(version, consumerrel) || check_version_5(version, consumerrel, description) || version
|
20
20
|
end
|
@@ -22,10 +22,12 @@ module Facter
|
|
22
22
|
|
23
23
|
private
|
24
24
|
|
25
|
-
def
|
25
|
+
def check_version_10_11(consumerrel, kernel_version)
|
26
|
+
build_number = kernel_version[/([^.]*)$/].to_i
|
27
|
+
|
28
|
+
return '11' if build_number >= 22_000
|
26
29
|
return '10' if consumerrel
|
27
30
|
|
28
|
-
build_number = kernel_version[/([^.]*)$/].to_i
|
29
31
|
if build_number >= 20_348
|
30
32
|
'2022'
|
31
33
|
elsif build_number >= 17_623
|
@@ -9,14 +9,14 @@ module Facter
|
|
9
9
|
DEBUG_MESSAGE = 'File at: %s is not accessible.'
|
10
10
|
|
11
11
|
def safe_read(path, default_return = '')
|
12
|
-
return File.read(path) if File.readable?(path)
|
12
|
+
return File.read(path, encoding: Encoding::UTF_8) if File.readable?(path)
|
13
13
|
|
14
14
|
log_failed_to_read(path)
|
15
15
|
default_return
|
16
16
|
end
|
17
17
|
|
18
18
|
def safe_readlines(path, default_return = [])
|
19
|
-
return File.readlines(path) if File.readable?(path)
|
19
|
+
return File.readlines(path, encoding: Encoding::UTF_8) if File.readable?(path)
|
20
20
|
|
21
21
|
log_failed_to_read(path)
|
22
22
|
default_return
|
data/lib/facter/version.rb
CHANGED
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.2.
|
4
|
+
version: 4.2.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|