Sha256: 49a61866e0d5156b5f0fc27ae88adb191fe40b6c3f1c433cf6baa64451175f8e
Contents?: true
Size: 534 Bytes
Versions: 16
Compression:
Stored size: 534 Bytes
Contents
# @since 4.8.0 # Puppet::Functions.create_function(:json_data) do dispatch :json_data do param 'Struct[{path=>String[1]}]', :options param 'Puppet::LookupContext', :context end def json_data(options, context) path = options['path'] begin JSON.parse(Puppet::FileSystem.read(path, :encoding => 'utf-8')) rescue JSON::ParserError => ex # Filename not included in message, so we add it here. raise Puppet::DataBinding::LookupError, "Unable to parse (#{path}): #{ex.message}" end end end
Version data entries
16 entries across 16 versions & 1 rubygems