Module: Puppet::Plugins::DataProviders::DataProvider Deprecated Private
- Included in:
- EnvironmentDataProvider, ModuleDataProvider, PathBasedDataProvider
- Defined in:
- lib/puppet/plugins/data_providers/data_provider.rb
Overview
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.
Constant Summary
Constants included from Puppet::Pops::Lookup::SubLookup
Puppet::Pops::Lookup::SubLookup::SPECIAL
Instance Method Summary collapse
- #data_key(key, lookup_invocation) ⇒ String? deprecated private Deprecated.
- #key_lookup(key, lookup_invocation, merge) ⇒ Object private
- #lookup(key, lookup_invocation, merge) ⇒ Object deprecated private Deprecated.
- #name ⇒ Object private
- #post_process(value, lookup_invocation) ⇒ Object deprecated private Deprecated.
- #unchecked_key_lookup(key, lookup_invocation, merge) ⇒ Object private
-
#unchecked_lookup(key, lookup_invocation, merge) ⇒ Object
private
Performs a lookup with the assumption that a recursive check has been made.
- #validate_data(data, data_key) ⇒ Object deprecated private Deprecated.
Methods included from Puppet::Pops::Lookup::Interpolation
Methods included from Puppet::Pops::Lookup::SubLookup
Methods included from Puppet::Pops::Lookup::DataProvider
#key_lookup_in_default, key_type, #module_name, register_types, #validate_data_hash, #validate_data_value, #value_is_validated?, value_type
Instance Method Details
#data_key(key, lookup_invocation) ⇒ String?
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.
Obtain an optional key to use when retrieving the data.
89 90 91 92 93 94 95 |
# File 'lib/puppet/plugins/data_providers/data_provider.rb', line 89 def data_key(key, lookup_invocation) unless Puppet[:strict] == :off Puppet.warn_once(:deprecation, 'DataProvider#data_key', 'DataProvider#data_key is deprecated and will be removed in the next major version of Puppet') end nil end |
#key_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.
12 13 14 |
# File 'lib/puppet/plugins/data_providers/data_provider.rb', line 12 def key_lookup(key, lookup_invocation, merge) lookup(key.to_s, lookup_invocation, merge) end |
#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.
21 22 23 |
# File 'lib/puppet/plugins/data_providers/data_provider.rb', line 21 def lookup(key, lookup_invocation, merge) lookup_invocation.check(key) { unchecked_lookup(key, lookup_invocation, merge) } end |
#name ⇒ 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.
112 113 114 115 |
# File 'lib/puppet/plugins/data_providers/data_provider.rb', line 112 def name cname = self.class.name cname[cname.rindex(':')+1..-1] end |
#post_process(value, 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.
Perform optional post processing of found value. The default implementation resolves interpolation expressions
57 58 59 |
# File 'lib/puppet/plugins/data_providers/data_provider.rb', line 57 def post_process(value, lookup_invocation) interpolate(value, lookup_invocation, true) end |
#unchecked_key_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.
16 17 18 |
# File 'lib/puppet/plugins/data_providers/data_provider.rb', line 16 def unchecked_key_lookup(key, lookup_invocation, merge) unchecked_lookup(key.to_s, lookup_invocation, merge) 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 with the assumption that a recursive check has been made.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/puppet/plugins/data_providers/data_provider.rb', line 30 def unchecked_lookup(key, lookup_invocation, merge) unless Puppet[:strict] == :off Puppet.warn_once(:deprecation, 'DataProvider#unchecked_lookup', 'DataProvider#unchecked_lookup is deprecated and will be removed in the next major version of Puppet') end segments = split_key(key) root_key = segments.shift lookup_invocation.with(:data_provider, self) do hash = data(data_key(root_key, lookup_invocation), lookup_invocation) value = hash[root_key] if value || hash.include?(root_key) value = sub_lookup(key, lookup_invocation, segments, value) unless segments.empty? lookup_invocation.report_found(key, post_process(value, lookup_invocation)) else lookup_invocation.report_not_found(key) throw :no_such_key end end end |
#validate_data(data, data_key) ⇒ 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.
118 119 120 |
# File 'lib/puppet/plugins/data_providers/data_provider.rb', line 118 def validate_data(data, data_key) data end |