We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5accef0 commit 2de34c8Copy full SHA for 2de34c8
lib/puppet/parser/functions/loadjson.rb
@@ -50,12 +50,13 @@ module Puppet::Parser::Functions
50
warning("Can't load '#{url}' HTTP Error Code: '#{res.status[0]}'")
51
args[1]
52
end
53
+
54
if Puppet::Util::Package.versioncmp(Puppet.version, '8.0.0').negative?
55
PSON.load(contents) || args[1]
56
else
57
JSON.parse(contents) || args[1]
58
- elsif File.exist?(args[0]) # rubocop:disable Lint/DeprecatedClassMethods : Changing to .exist? breaks the code
59
+ elsif File.exist?(args[0])
60
content = File.read(args[0])
61
62
PSON.load(content) || args[1]
0 commit comments