You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The support for Deferred means that someone that gets a catalog must resolve any Deferred values in that catalog before it it is applied.
This is achieved by calling the following: Puppet::Pops::Evaluator::DeferredResolver.resolve_and_replace(node.facts, catalog) where the resolver is given facts and the catalog.
The catalog will be mutated such that all Deferred and Binary data types are changed to the result of calling the deferred function and Binary values are changed to ASCII-8BIT encoded String values. It is possible to give nil as facts, but then there are no values in $facts which evaluation of deferred functions may depend on.
If resolution of deferred is not done, types and providers will receive values of those data types and the outcome will be something other than the expected.
A call to the DeferredResolver.resolve_and_replace can be done just before calling to_ral (that is what puppet apply does).
Testing code that includes the need to resolve a Deferred value does not seem to be possible with the current version of rspec-puppet. The issue is demonstrated in https://github.com/genebean/genebean-deferred_testing
The text was updated successfully, but these errors were encountered: