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

Make call() function resolve Deferred values

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • PUP 6.0.0
    • Language, Type System
    • None
    • New Feature
    • 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).
    • 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

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support