This is a heads up to anyone who has written code that calls custom
functions. We are making a change in Puppet 3.0 that will make the
calls reject incorrect calls (see bug #15756). Calling functions from
ruby code (either other functions or erb templates) was always
supposed to be done by placing all of the arguments in an array and
passing the array to the method call. This was using done by
surrounding the arguments with square brackets.

    function_template( [ 'my_template.erb' ] )

Some, but not all, functions had been written in a way that would by
chance work when this was not done. The template function is one such
example. It would work if you were running on a 1.8 ruby if it was
called as:

    function_template( 'my_template.erb' )

However, if you tried running on a 1.9 ruby that function call would
fail with an error about not having a method named 'collect' on a
String, which is caused by a change in the String class in ruby. To
prevent these kinds of errors in the future, Puppet 3.0 is going to
check that the arguments are passed in an array and fail if they are
not.

I did a quick check across the code available in the Forge and it
doesn't look like it was too common that this was done wrong, but you
might want to check through your code for calls of functions where the
arguments are not being passed in an array, and change them to use an
array.

NOTE: If you have only ever called custom functions from inside the
Puppet Language, then you don't need to worry about anything, this
does not apply to that.

Thanks,
Andrew Parker
Puppet Team Lead

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to