Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-8641

Make call() function resolve Deferred values

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 6.0.0
    • Component/s: Language, Type System
    • Labels:
      None
    • Release Notes:
      New Feature
    • Release Notes Summary:
      It is now possible to resolve a {{Deferred}} value by using the {{call}} function. It can resolve a deferred function call, and a deferred variable dereference (with support to {{dig}} into a structured value).
    • QA Risk Assessment:
      Needs Assessment

      Description

      While the primary use of a Deferred is to defer the evaluation to catalog apply time it is very useful to also be able to resolve values when compiling:

      • For the purpose of testing Deferred values
      • To delay the evaluation of an expensive function until it is actually needed
      • To delay a reference to a variable that may not yet exist

      The same can be achieved without Deferred by instead of creating a Deferred the information would be encoded in a hash or array, and the receiver making a call to call or other functions (typically an ERB template) to get a variable value via indirect name reference.

      See PUP-8635 for the Deferred data type.

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                tony.vu Tony Vu
                Reporter:
                henrik.lindberg Henrik Lindberg
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: