Module: Puppet::DataProviders::HieraSupport Private

Included in:
HieraEnvDataProvider, HieraModuleDataProvider
Defined in:
lib/puppet/data_providers/hiera_support.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#config_pathObject

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.



5
6
7
# File 'lib/puppet/data_providers/hiera_support.rb', line 5

def config_path
  @hiera_config.nil? ? 'not yet configured' : @hiera_config.config_path
end

#nameObject

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.



9
10
11
# File 'lib/puppet/data_providers/hiera_support.rb', line 9

def name
  'Hiera Data Provider' + (@hiera_config.nil? ? '' : ", version #{@hiera_config.version}")
end

#unchecked_lookup(key, lookup_invocation, merge) ⇒ 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.

Performs a lookup by searching all given paths for the given key. A merge will be performed if the value is found in more than one location and merge is not nil.

Parameters:



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/puppet/data_providers/hiera_support.rb', line 19

def unchecked_lookup(key, lookup_invocation, merge)
  lookup_invocation.with(:data_provider, self) do
    merge_strategy = Puppet::Pops::MergeStrategy.strategy(merge)
    lookup_invocation.with(:merge, merge_strategy) do
      merged_result = merge_strategy.merge_lookup(data_providers(data_key(key, lookup_invocation), lookup_invocation)) do |data_provider|
        data_provider.unchecked_lookup(key, lookup_invocation, merge_strategy)
      end
      lookup_invocation.report_result(merged_result)
    end
  end
end