Sha256: 5e086f5b65ce71a96477e750c1fcca494415145fc7dd1bcaa96ccf1c35783302

Contents?: true

Size: 903 Bytes

Versions: 12

Compression:

Stored size: 903 Bytes

Contents

require_relative 'configured_data_provider'

module Puppet::Pops
module Lookup
# @api private
class EnvironmentDataProvider < ConfiguredDataProvider
  def place
    'Environment'
  end

  protected

  def assert_config_version(config)
    if config.version > 3
      config
    else
      if Puppet[:strict] == :error
        raise Puppet::DataBinding::LookupError, "#{config.name} cannot be used in an environment"
      else
        Puppet.warn_once(:hiera_v3_at_env_root, config.config_path, 'hiera.yaml version 3 found at the environment root was ignored')
      end
      nil
    end
  end

  # Return the root of the environment
  #
  # @param lookup_invocation [Invocation] The current lookup invocation
  # @return [Pathname] Path to root of the environment
  def provider_root(lookup_invocation)
    Pathname.new(lookup_invocation.scope.environment.configuration.path_to_env)
  end
end
end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
puppet-4.9.4 lib/puppet/pops/lookup/environment_data_provider.rb
puppet-4.9.4-x86-mingw32 lib/puppet/pops/lookup/environment_data_provider.rb
puppet-4.9.4-x64-mingw32 lib/puppet/pops/lookup/environment_data_provider.rb
puppet-4.9.4-universal-darwin lib/puppet/pops/lookup/environment_data_provider.rb
puppet-4.9.3 lib/puppet/pops/lookup/environment_data_provider.rb
puppet-4.9.3-x86-mingw32 lib/puppet/pops/lookup/environment_data_provider.rb
puppet-4.9.3-x64-mingw32 lib/puppet/pops/lookup/environment_data_provider.rb
puppet-4.9.3-universal-darwin lib/puppet/pops/lookup/environment_data_provider.rb
puppet-4.9.2 lib/puppet/pops/lookup/environment_data_provider.rb
puppet-4.9.2-x86-mingw32 lib/puppet/pops/lookup/environment_data_provider.rb
puppet-4.9.2-x64-mingw32 lib/puppet/pops/lookup/environment_data_provider.rb
puppet-4.9.2-universal-darwin lib/puppet/pops/lookup/environment_data_provider.rb