Issue #1824 has been updated by abnormaliti.

i also have experienced this problem. here is a real work example.

Function:
<pre>
module Puppet::Parser::Functions
  newfunction(:file_append, :type => :rvalue) do |args|
    if args[0].is_a?(Array)
      output = args[0].map { |val| val + "/" + args[1] }
    else
      output = args[0] + "/" + args[1]
    end
    output
  end
end
</pre>

Manifest:
<pre>
define talk (){ info($title) }

$s = [ "/test/path", "/test/path/2/" ]
$f = "filename.txt"

$a = file_append($s,$f)

talk { $a: }
</pre>

correct result with 0.24.6
<pre>
info: Scope(Talk[/test/path/2//filename.txt]): /test/path/2//filename.txt
info: Scope(Talk[/test/path/filename.txt]): /test/path/filename.txt
</pre>

incorrect result with 0.24.7
<pre>
info: Scope(Talk[/test/path//test/path/2/]): /test/path//test/path/2/
</pre>
----------------------------------------
Bug #1824: passing arrays to custom functions stopped working in 0.24.7
http://projects.reductivelabs.com/issues/show/1824

Author: marlon
Status: Unreviewed
Priority: High
Assigned to: 
Category: functions
Target version: unplanned
Complexity: Unknown
Affected version: 0.24.6
Keywords: 


the custom function:

module Puppet::Parser::Functions
        newfunction(:somefunction, :type => :rvalue) do |args|

        File.open("/tmp/puppet", 'a') { |fd| fd.puts args[0].is_a?(Array) }

        end
end

puppet code:

$array = ["a", "b", "c"]
$useless_var = somefunction($array)

After catting the /tmp/puppet file on the puppetmaster on version 0.24.6 it 
returned True, on 0.24.7 it returned False.


----------------------------------------
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://reductivelabs.com/redmine/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
-~----------~----~----~----~------~----~------~--~---

Reply via email to