Issue #22729 has been updated by Melissa Stone.

Released in Puppet 3.4.0-rc1

----------------------------------------
Bug #22729: New future-parser-only functions are loaded although one is not 
using the future parser
https://projects.puppetlabs.com/issues/22729#change-100929

* Author: Peter Meier
* Status: Closed
* Priority: Normal
* Assignee: Henrik Lindberg
* Category: functions
* Target version: 3.4.0
* Affected Puppet version: 3.3.0
* Keywords: 
* Branch: https://github.com/puppetlabs/puppet/pull/1985
----------------------------------------
Since 3.2 there is now a function reject, that is part of the new future 
parser. In the description of the function it is noted, that this function 
requires the future parser.

However, there is also a popular function called reject in the stdlib module, 
which works with the old parser.

If somebody tries to use the stdlib-function with a puppet version > 3.2 
without having the stdlib module in their modulepath, they encounter a weird 
error, that is not really helpful: 
https://github.com/duritong/puppet-munin/issues/21

<pre>
# puppet --version
3.3.0
# puppet apply -e "notice reject(['a','b'],'b')"
Error: reject(): wrong argument type (String; must be a parameterized block. at 
line 1 on node foo
Wrapped exception:
reject(): wrong argument type (String; must be a parameterized block.
Error: reject(): wrong argument type (String; must be a parameterized block. at 
line 1 on node foo
</pre>

So there are two problems here:

1. People should use the stlib module if the requirements say so.
2. Although the new reject function is future-parser-only it is still available 
if puppet does not use the future parser.

If the last point would not be the case, the error would have been something 
like: "Unknown function reject" and it would have been pretty obvious that the 
user is missing the stdlib module.

So if puppet starts shipping future-parser-only functions it should ensure that 
they are also only available if the future parser is used. Otherwise this is 
not very user friendly and actually we can be happy, that module-contributed 
functions are loaded *before* built-in functions, otherwise the stdlib module 
would not be usable at all any more.

Also note, that the wrapped exception is identical to the first displayed one, 
which is not very helpful either and which also would have made it easier to 
spot the problem in the first place, but this is something for another ticket.


-- 
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 puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to