Jira (PUP-7527) Insufficient error message when erroneously passing a Collection containing non-Data values for a Data parameter

6 views
Skip to first unread message

Ryan Whitehurst (JIRA)

unread,
May 13, 2017, 1:43:02 AM5/13/17
to puppe...@googlegroups.com
Ryan Whitehurst created an issue
 
Puppet / Bug PUP-7527
Insufficient error message when erroneously passing a Collection containing non-Data values for a Data parameter
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2017/05/12 10:42 PM
Priority: Normal Normal
Reporter: Ryan Whitehurst

Sample code:

function foo (
  Data $var,
) {
  notice($var)
}
 
foo([Resource[file]])

produces the output

Error: Evaluation Error: Error while evaluating a Function Call, 'foo' parameter 'var' expects a Data value, got Tuple at data_type_error.pp:7:1 on node example.com

It's not obvious why that's invalid, because a Tuple can match Data, but only if all its elements match Data.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Henrik Lindberg (JIRA)

unread,
May 14, 2017, 5:56:02 PM5/14/17
to puppe...@googlegroups.com
Henrik Lindberg commented on Bug PUP-7527
 
Re: Insufficient error message when erroneously passing a Collection containing non-Data values for a Data parameter

You would want to the know the path to element in the given value that is not Data compliant so you can do something about it. Clearly the information shown for the mismatch is not enough.

Henrik Lindberg (JIRA)

unread,
May 14, 2017, 5:56:03 PM5/14/17
to puppe...@googlegroups.com

Henrik Lindberg (JIRA)

unread,
May 14, 2017, 5:57:02 PM5/14/17
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
May 16, 2017, 7:30:06 PM5/16/17
to puppe...@googlegroups.com

Moses Mendoza (JIRA)

unread,
May 18, 2017, 2:05:24 PM5/18/17
to puppe...@googlegroups.com

Christopher Wood (JIRA)

unread,
Sep 20, 2017, 2:18:03 PM9/20/17
to puppe...@googlegroups.com
Christopher Wood commented on Bug PUP-7527
 
Re: Insufficient error message when erroneously passing a Collection containing non-Data values for a Data parameter

I ran into a bit of the same thing trying to send around file resource defaults via class parameter.

 

  1. https://docs.puppet.com/puppet/latest/lang_resources_advanced.html#setting-attributes-from-a-hash
    $file = { 'group' => 'groupname', 'mode' => '0640', 'notify' => Service[$service], 'owner' => 'root', 'require' => Package[$package], }

class

{ '::myclass::backend': file => $file, toggle => true, }

 

Part of the "Error while evaluating a Resource Statement":

parameter 'file' entry 'notify' expects a Data value, got Type

parameter 'file' entry 'require' expects a Data value, got Tuple

And the line/character is the start of the resource-style class declaration.

David McTavish (Jira)

unread,
Dec 6, 2021, 1:10:01 PM12/6/21
to puppe...@googlegroups.com
David McTavish updated an issue
 
Change By: David McTavish
Labels: usability
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

David McTavish (Jira)

unread,
Dec 6, 2021, 1:10:01 PM12/6/21
to puppe...@googlegroups.com

David McTavish (Jira)

unread,
Dec 6, 2021, 1:45:01 PM12/6/21
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages