facter 4.2.11 → 4.2.12
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '098fd60710cceb1a13598b4a2bc95e407ef3b196ca050f54c86af4f53055ec89'
|
4
|
+
data.tar.gz: 4203dae20b429320376bb4b8302bf9e549104c30781ebd19b023625be2d351dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf7bc0aee205b9cffca4e422e55449f033132d0552df44185c216fda3a87f3278e7ad14bb9f602db8812009db965f48503a0d7e227a4929b7b84d16c70fd2c9f
|
7
|
+
data.tar.gz: 0d1c7af1a8d5244d8504dd50f95485a519249cd0ac2a7715e62fea18e16557a076e215756e5f1b4783aae9069a269bda3e2843f106e34b83a0db313bfc2db0af
|
@@ -9,6 +9,10 @@ module Facter
|
|
9
9
|
DEFAULT_COMMAND_EXTENSIONS = %w[.COM .EXE .BAT .CMD].freeze
|
10
10
|
|
11
11
|
def which(bin)
|
12
|
+
# `echo` is allowed for facter 3.x compatibility, otherwise
|
13
|
+
# all commands much be found on the PATH or absolute.
|
14
|
+
return bin if /^echo$/i =~ bin
|
15
|
+
|
12
16
|
if absolute_path?(bin)
|
13
17
|
return bin if File.executable?(bin)
|
14
18
|
else
|
@@ -70,7 +70,11 @@ module LegacyFacter
|
|
70
70
|
def parse_executable_output(output)
|
71
71
|
res = nil
|
72
72
|
begin
|
73
|
-
res =
|
73
|
+
res = if Gem::Version.new(Psych::VERSION) >= Gem::Version.new('3.1.0') # Ruby 2.6+
|
74
|
+
YAML.safe_load(output, permitted_classes: [Symbol, Time])
|
75
|
+
else
|
76
|
+
YAML.safe_load(output, [Symbol, Time])
|
77
|
+
end
|
74
78
|
rescue StandardError => e
|
75
79
|
Facter.debug("Could not parse executable fact output as YAML or JSON (#{e.message})")
|
76
80
|
end
|
@@ -114,7 +118,11 @@ module LegacyFacter
|
|
114
118
|
# Add quotes to Yaml time
|
115
119
|
cont = content.gsub(TIME, '"\1"')
|
116
120
|
|
117
|
-
|
121
|
+
if Gem::Version.new(Psych::VERSION) >= Gem::Version.new('3.1.0') # Ruby 2.6+
|
122
|
+
YAML.safe_load(cont, permitted_classes: [Date], aliases: true)
|
123
|
+
else
|
124
|
+
YAML.safe_load(cont, [Date], [], [], true)
|
125
|
+
end
|
118
126
|
end
|
119
127
|
end
|
120
128
|
|
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.12
|
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-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|