openfact 5.4.0 → 5.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/facter/resolvers/linux/containers.rb +2 -0
- data/lib/facter/resolvers/networking.rb +24 -0
- data/lib/facter/resolvers/openbsd/mountpoints.rb +16 -6
- data/lib/facter/resolvers/os_release.rb +1 -1
- data/lib/facter/resolvers/uname.rb +4 -0
- data/lib/facter/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 937929da6c35dd97cfd2fcf36876790643ddf49bd0a8cc67b60e5e0f9783086b
|
|
4
|
+
data.tar.gz: c28a8b66a62eed18ac3dd29ec87f4f054dbc06178d0cb75bfe2b0e1f8227feee
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 467c57b11e8019de5c6e4ba21686100beb6ad3d7a79d896a333aa0d12ef4561d7a8026d0627aac0ad2ff0d808909883944892459198c0f5941d0bffed1ad02b6
|
|
7
|
+
data.tar.gz: 690faa02abfad3b086339b62351b4cc78f4a9669f9dec61bcedc7b64dd9d852c73fcc111bfed72bd7ae7ba245c3238ea8fc98b818021bb86784999bb275dfecd
|
|
@@ -49,8 +49,12 @@ module Facter
|
|
|
49
49
|
interfaces_data.each do |interface_name, raw_data|
|
|
50
50
|
parsed_interface_data = {}
|
|
51
51
|
|
|
52
|
+
extract_flags(raw_data, parsed_interface_data)
|
|
53
|
+
extract_rdomain(raw_data, parsed_interface_data)
|
|
52
54
|
extract_mtu(raw_data, parsed_interface_data)
|
|
53
55
|
extract_mac(raw_data, parsed_interface_data)
|
|
56
|
+
extract_description(raw_data, parsed_interface_data)
|
|
57
|
+
extract_groups(raw_data, parsed_interface_data)
|
|
54
58
|
extract_dhcp(interface_name, raw_data, parsed_interface_data)
|
|
55
59
|
extract_ip_data(raw_data, parsed_interface_data)
|
|
56
60
|
|
|
@@ -59,11 +63,31 @@ module Facter
|
|
|
59
63
|
@fact_list[:interfaces] = parsed_interfaces_data unless parsed_interfaces_data.empty?
|
|
60
64
|
end
|
|
61
65
|
|
|
66
|
+
def extract_flags(raw_data, parsed_interface_data)
|
|
67
|
+
flags = raw_data.match(/flags=\d+<(.+)>/)&.captures&.first
|
|
68
|
+
parsed_interface_data[:flags] = flags.split(',') unless flags.nil?
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def extract_rdomain(raw_data, parsed_interface_data)
|
|
72
|
+
rdomain = raw_data.match(/rdomain\s+(\d+)/)&.captures&.first&.to_i
|
|
73
|
+
parsed_interface_data[:rdomain] = rdomain unless rdomain.nil?
|
|
74
|
+
end
|
|
75
|
+
|
|
62
76
|
def extract_mtu(raw_data, parsed_interface_data)
|
|
63
77
|
mtu = raw_data.match(/mtu\s+(\d+)/)&.captures&.first&.to_i
|
|
64
78
|
parsed_interface_data[:mtu] = mtu unless mtu.nil?
|
|
65
79
|
end
|
|
66
80
|
|
|
81
|
+
def extract_description(raw_data, parsed_interface_data)
|
|
82
|
+
description = raw_data.match(/description:\s+(.+)/)&.captures&.first
|
|
83
|
+
parsed_interface_data[:description] = description unless description.nil?
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def extract_groups(raw_data, parsed_interface_data)
|
|
87
|
+
groups = raw_data.match(/groups:\s+(.+)/)&.captures&.first
|
|
88
|
+
parsed_interface_data[:groups] = groups.split("\s") unless groups.nil?
|
|
89
|
+
end
|
|
90
|
+
|
|
67
91
|
def extract_mac(raw_data, parsed_interface_data)
|
|
68
92
|
mac = raw_data.match(/(?:ether|lladdr)\s+((?:\w?\w:){5}\w?\w)|(?:infiniband)\s+((?:\w?\w:){19}\w?\w)/)
|
|
69
93
|
&.captures&.compact&.first
|
|
@@ -17,7 +17,7 @@ module Facter
|
|
|
17
17
|
|
|
18
18
|
def read_mount(fact_name)
|
|
19
19
|
@fact_list[:mountpoints] = {}
|
|
20
|
-
output = Facter::Core::Execution.execute('mount', logger: log)
|
|
20
|
+
output = Facter::Core::Execution.execute('mount -v', logger: log)
|
|
21
21
|
output.split("\n").map do |line|
|
|
22
22
|
add_mount_points_fact(line)
|
|
23
23
|
end
|
|
@@ -27,11 +27,21 @@ module Facter
|
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
def add_mount_points_fact(line)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
(*tokens, options) = line.split(/\s*\(|\)\s*/, 0)
|
|
31
|
+
|
|
32
|
+
if tokens.length == 3
|
|
33
|
+
(device, duid, tokens) = tokens
|
|
34
|
+
else
|
|
35
|
+
(device, tokens) = tokens[0].split("\s", 2)
|
|
36
|
+
end
|
|
37
|
+
(_on, path, _type, filesystem) = tokens.split("\s")
|
|
38
|
+
|
|
39
|
+
@fact_list[:mountpoints][path] = {
|
|
40
|
+
device: device,
|
|
41
|
+
duid: duid,
|
|
42
|
+
filesystem: filesystem,
|
|
43
|
+
options: options.split(",\s")
|
|
44
|
+
}.compact
|
|
35
45
|
end
|
|
36
46
|
|
|
37
47
|
def retrieve_sizes_for_mounts
|
|
@@ -35,6 +35,10 @@ module Facter
|
|
|
35
35
|
@fact_list[:kernelrelease],
|
|
36
36
|
@fact_list[:kernelname],
|
|
37
37
|
@fact_list[:kernelversion] = uname_results.map(&:strip)
|
|
38
|
+
# uutils/coreutils uname does not implement -p and returns "unknown".
|
|
39
|
+
# Fall back to -m (machine), which is the procedure suggested by the
|
|
40
|
+
# uutils/coreutils developers.
|
|
41
|
+
@fact_list[:processor] = @fact_list[:machine] if @fact_list[:processor] == 'unknown'
|
|
38
42
|
else
|
|
39
43
|
log.warn('Request to uname returned no output. Uname related facts are not populated.')
|
|
40
44
|
end
|
data/lib/facter/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: openfact
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.
|
|
4
|
+
version: 5.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OpenVox Project
|
|
@@ -301,6 +301,20 @@ dependencies:
|
|
|
301
301
|
- - "<"
|
|
302
302
|
- !ruby/object:Gem::Version
|
|
303
303
|
version: '2'
|
|
304
|
+
- !ruby/object:Gem::Dependency
|
|
305
|
+
name: tsort
|
|
306
|
+
requirement: !ruby/object:Gem::Requirement
|
|
307
|
+
requirements:
|
|
308
|
+
- - "<"
|
|
309
|
+
- !ruby/object:Gem::Version
|
|
310
|
+
version: '0.3'
|
|
311
|
+
type: :runtime
|
|
312
|
+
prerelease: false
|
|
313
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
314
|
+
requirements:
|
|
315
|
+
- - "<"
|
|
316
|
+
- !ruby/object:Gem::Version
|
|
317
|
+
version: '0.3'
|
|
304
318
|
description: You can prove anything with facts!
|
|
305
319
|
email:
|
|
306
320
|
- openvox@voxpupuli.org
|
|
@@ -1288,7 +1302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
1288
1302
|
- !ruby/object:Gem::Version
|
|
1289
1303
|
version: '0'
|
|
1290
1304
|
requirements: []
|
|
1291
|
-
rubygems_version: 4.0.
|
|
1305
|
+
rubygems_version: 4.0.6
|
|
1292
1306
|
specification_version: 4
|
|
1293
1307
|
summary: OpenFact, a system inventory tool
|
|
1294
1308
|
test_files: []
|