Sha256: 5ae2b64e6339e954ca9a79e9ff37927744a3db6a67f262c08f5894c60ba68ce4
Contents?: true
Size: 1.45 KB
Versions: 68
Compression:
Stored size: 1.45 KB
Contents
# This file is loaded by the autoloader, and it does not find the data function support unless required relative # require 'json' module Puppet::DataProviders # TODO: API 5.0, remove this class # @api private # @deprecated class JsonDataProviderFactory < Puppet::Plugins::DataProviders::FileBasedDataProviderFactory def create(name, paths, parent_data_provider) unless Puppet[:strict] == :off Puppet.warn_once(:deprecation, 'Puppet::DataProviders::JsonDataProviderFactory', 'Puppet::DataProviders::JsonDataProviderFactory is deprecated and will be removed in the next major version of Puppet') end JsonDataProvider.new(name, paths, parent_data_provider) end def path_extension '.json' end end # TODO: API 5.0, remove this class # @api private # @deprecated class JsonDataProvider < Puppet::Plugins::DataProviders::PathBasedDataProvider def initialize_data(path, lookup_invocation) unless Puppet[:strict] == :off Puppet.warn_once(:deprecation, 'Puppet::DataProviders::JsonDataProvider', 'Puppet::DataProviders::JsonDataProvider is deprecated and will be removed in the next major version of Puppet') end 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
68 entries across 68 versions & 2 rubygems