Issue #21048 has been updated by Charlie Sharpsteen. Tracker changed from Bug to Feature Category changed from server to parser Status changed from Investigating to Accepted Affected Puppet version deleted (3.2.1) Keywords set to simplefix
This error was added due to #15756 because functions always expect arrays and in Ruby 1.8 Strings responded to array methods. In Puppet 2.7.x, errors that were thrown originated inside the functions themselves and this hid the real issue that the function needed an array of arguments. I'm reclassifying this as a feature request since the template line number was never included in the error messages thrown by ruby 2.7.x. ---------------------------------------- Feature #21048: error about functions with single array mentions only useless file and line numbers https://projects.puppetlabs.com/issues/21048#change-93128 * Author: Thomas Vander Stichele * Status: Accepted * Priority: Normal * Assignee: Charlie Sharpsteen * Category: parser * Target version: * Affected Puppet version: * Keywords: simplefix * Branch: ---------------------------------------- Here's an example message when upgrading from 2.7 to 3.x: err: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template credex/featcredex/featcredex.ini.erb: Filepath: /usr/lib/ruby/site_ruby/1.8/puppet/parser/functions.rb Line: 149 Detail: custom functions must be called with a single array that contains the arguments. For example, function_example([1]) instead of function_example(1) at /etc/puppet/environments/development/dev/modules/credex/manifests/featcredex.pp:72 on node ... It's great that it tells us the line of code in ruby where this error is thrown, and the line of code in my module where the template is being asked to expand. But since the actual error is in a template file, the only thing that's useful to report here is the line number in the template file where the problem is. I had a template with 20 function calls in it and it took a while to find the one that was wrong. -- 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.
