Class: Puppet::DataProviders::JsonDataProvider Deprecated Private
- Inherits:
-
Plugins::DataProviders::PathBasedDataProvider
- Object
- Plugins::DataProviders::PathBasedDataProvider
- Puppet::DataProviders::JsonDataProvider
- Defined in:
- lib/puppet/data_providers/json_data_provider_factory.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
TODO: API 5.0, remove this class
Constant Summary
Constants included from Pops::Lookup::SubLookup
Pops::Lookup::SubLookup::SPECIAL
Instance Attribute Summary
Attributes inherited from Plugins::DataProviders::PathBasedDataProvider
Instance Method Summary collapse
Methods inherited from Plugins::DataProviders::PathBasedDataProvider
#initialize, #load_data, #unchecked_lookup, #validate_data
Methods included from Plugins::DataProviders::DataProvider
#data_key, #key_lookup, #lookup, #name, #post_process, #unchecked_key_lookup, #unchecked_lookup, #validate_data
Methods included from Pops::Lookup::Interpolation
Methods included from Pops::Lookup::SubLookup
Methods included from Pops::Lookup::DataProvider
#key_lookup, #key_lookup_in_default, key_type, #lookup, #module_name, #name, register_types, #unchecked_key_lookup, #validate_data_hash, #validate_data_value, #value_is_validated?, value_type
Constructor Details
This class inherits a constructor from Puppet::Plugins::DataProviders::PathBasedDataProvider
Instance Method Details
#initialize_data(path, lookup_invocation) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/puppet/data_providers/json_data_provider_factory.rb', line 27 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.}" end |