Jira (PUP-10399) Error: wrong number of arguments (given 2, expected 1) Deferred fucntion

0 views
Skip to first unread message

Lucas Young (Jira)

unread,
Mar 27, 2020, 6:33:03 PM3/27/20
to puppe...@googlegroups.com
Lucas Young created an issue
 
Puppet / Bug PUP-10399
Error: wrong number of arguments (given 2, expected 1) Deferred fucntion
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2020/03/27 3:32 PM
Priority: Normal Normal
Reporter: Lucas Young

Puppet Version: Puppet 6.10.2
Puppet Server Version: 2019.2.2
OS Name/Version: Ubuntu 16.04

Actual Behavior: When setting up a deferred function if a difference number of arguments are passed into the dispatch declaration versus the actual method a Puppet run will generate the following error: "Error: Failed to apply catalog: wrong number of arguments (given 2, expected 1)"

The issue is that none of the file / line number information is returned as part of the error message above, offering no trace back to the origination of the error in the code base.

Code example:

 

 

dispatch :example do
  param 'String', :stuff
  optional_param 'String', :morestuff
end
def example(stuff)
  return stuff + 1
end

 

When the same code is ran and it is not a Deferred function, a file / line number is included in that error message.  

Desired behavior: Generate an error message with a line / file indication: "Error: Failed tp apply catalog, wrong number of arguments (given 2, expected 1) (file: /home/test_user/Working/custom_function_repro/modules/test_module/manifests/init.pp, line: 2, column: 8)"

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages