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

cannot call 4.x functions from 3.x function ERB templates

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 3.8.2, PUP 4.2.0
    • Component/s: DOCS
    • Labels:
      None
    • Template:
    • Story Points:
      2
    • Sprint:
      Language 2015-06-24
    • Release Notes:
      Bug Fix

      Description

      It is not possible to call a 4.x function from a 3.x function or ERB template because that logic does not have ready access to a mechanism to perform such a call correctly.

      We should add a new method of scope that works the same way as how the puppet language evaluator performs the call. i.e.:

      • The call is made with arguments using ruby/4.x semantics (no funny undef stuff)
      • If a 4.x function is found it wins
      • If a 3.x function is found the arguments are transformed to the 3.x convention (i.e. undef funny stuff).
      • in a 3.x version, 4.x. functions are only found if parser==future.

      The solution is to add a method call_function on Scope. It accepts the name of a function as its first argument, followed by all arguments in an Array. It also accepts a Ruby block (as a lambda).

      ORIGINAL REPORT


      escaped and reported from outside:
      https://groups.google.com/forum/#!msg/puppet-users/Ht_5d2Wb6VA/v1lVtw031DkJ

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              erict Eric Thompson
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Agile