Issue #7991 has been updated by Daniel Pittman. Status changed from Accepted to Merged - Pending Release Target version set to 2.7.5
Passed tests; merged back as https://github.com/puppetlabs/puppet/commit/8012a7bbe4bcad46ca51edbc1d21f0701606ec5f ---------------------------------------- Bug #7991: Issue with using custom functions in templates. https://projects.puppetlabs.com/issues/7991 Author: Trevor Vaughan Status: Merged - Pending Release Priority: Normal Assignee: Category: parser Target version: 2.7.5 Affected Puppet version: 2.6.0 Keywords: custom function, template Branch: https://github.com/mmrobins/puppet/commit/9292d4c998296fd5aa631adb9c235b1f0c4e4204 To use a custom function in a template, you must do something like the following: `$var = inline_template("<%= Puppet::Parser::Functions::function('myfunction'); '' %><%= scope.function_myfunction(options) %>")` Furthermore, to make this work in any order, you must stick something like the following in your code: `if false { myfunction('blah') }` However, if you do this *anywhere at all*, you can no longer do the following: `$var = myfunction('foo')` Why? I have no idea! But it certainly doesn't seem like it should work this way. Seems to affect all Puppet versions that I've tried. <= 2.6.6 -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
