Sha256: bba64f2f5b781f5cc1643e3bc6ffb886b233236ca58b4a45abd8fad178344179
Contents?: true
Size: 889 Bytes
Versions: 42
Compression:
Stored size: 889 Bytes
Contents
# This file is loaded by the autoloader, and it does not find the data function support unless required relative # require 'yaml' module Puppet::DataProviders class YamlDataProviderFactory < Puppet::Plugins::DataProviders::FileBasedDataProviderFactory def create(name, paths, parent_data_provider) YamlDataProvider.new(name, paths, parent_data_provider) end def path_extension '.yaml' end end class YamlDataProvider < Puppet::Plugins::DataProviders::PathBasedDataProvider def initialize_data(path, lookup_invocation) data = YAML.load_file(path) HieraConfig.symkeys_to_string(data.nil? ? {} : data) rescue YAML::SyntaxError => ex # Psych errors includes the absolute path to the file, so no need to add that # to the message raise Puppet::DataBinding::LookupError, "Unable to parse #{ex.message}" end end end
Version data entries
42 entries across 42 versions & 2 rubygems