Issue #7991 has been updated by Charlie Sharpsteen.

Keywords changed from custom function, template to custom function, template 
customer

----------------------------------------
Bug #7991: Issue with using custom functions in templates.
https://projects.puppetlabs.com/issues/7991#change-88635

* Author: Trevor Vaughan
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: parser
* Target version: 2.7.5
* Affected Puppet version: 2.6.0
* Keywords: custom function, template customer
* 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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to