Issue #21252 has been updated by Vadim Lebedev.

After merge with https://github.com/puppetlabs/puppet/pull/1710.

All good from console:

On master:

puppet apply --parser future -e '[1,20,3].collect |$value| {$value < 10 }.each 
|$value| { notice $value }'
Notice: Scope(Class[main]): true
Notice: Scope(Class[main]): false
Notice: Scope(Class[main]): true
Notice: Finished catalog run in 0.11 seconds


On node:

puppet apply --parser future -e '[1,20,3].collect |$value| {$value < 10 }.each 
|$value| { notice $value }'
Notice: Scope(Class[main]): true
Notice: Scope(Class[main]): false
Notice: Scope(Class[main]): true
Notice: Finished catalog run in 0.11 seconds


Trouble with manifest:

node 'xxx' {
        [1,20,3].collect |$value| {$value < 10 }.each |$value| { notice $value }
}

Compile node on master – success.

Execute puppet as agent on node – faild.

puppet agent --server maas.rg.ru --test --debug
.
.
.
Debug: catalog supports formats: b64_zlib_yaml dot pson raw yaml; using pson
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Could not parse for environment production: Attempt to use unsupported range in 
a '[]' expression, 3 values given for max 1 at /etc/puppet/nodes/xxx.pp:2 on 
node xxx
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run


----------------------------------------
Bug #21252: lambda produces nil for false, and does not accept nil as argument
https://projects.puppetlabs.com/issues/21252#change-93239

* Author: Vadim Lebedev
* Status: In Topic Branch Pending Review
* Priority: Normal
* Assignee: Henrik Lindberg
* Category: parser
* Target version: 
* Affected Puppet version: 3.2.1
* Keywords: parser lambda false return
* Branch: https://github.com/puppetlabs/puppet/pull/1710
----------------------------------------
This is example from official documentation:

<pre>
[1,20,3].collect |$value| {$value < 10 }.each |$value| { notice $value }

# produces the output
Notice: Scope(Class[main]): 1
Notice: Scope(Class[main]): 3
</pre>

On my pueppet:

<pre>
puppet apply --parser future -e '[1,20,3].collect |$value| {$value < 10 }.each 
|$value| { notice $value }'
Notice: Scope(Class[main]): true
Error: Too few arguments; 1 for 1 at :1 on node xxx
Error: Too few arguments; 1 for 1 at :1 on node xxx

Ubuntu 12.04
Puppet install from puppetlabs repo. 

dpkg -l
puppetmaster 3.2.1-1puppetlabs1 
</pre>


-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to