Jira (PUP-8346) File type content attribute accepts non-strings

4 views
Skip to first unread message

Pär Lindfors (JIRA)

unread,
Jan 11, 2018, 4:13:02 PM1/11/18
to puppe...@googlegroups.com
Pär Lindfors created an issue
 
Puppet / Bug PUP-8346
File type content attribute accepts non-strings
Issue Type: Bug Bug
Affects Versions: PUP 5.3.3
Assignee: Unassigned
Components: Types and Providers
Created: 2018/01/11 1:12 PM
Priority: Normal Normal
Reporter: Pär Lindfors

Puppet Version: 5.3.3, 3.8.7, 2.7.26

The documentation of the file type's content attribute is: "The desired contents of a file, as a string."

However an array of strings is also accepted. When content is set to an array, the last element of the array is used as content. I don't know if this behaviour is intended, it is not documented as far as I can tell. This behaviour is not new, I tested using Puppet 5.3, 3.8, 2.7 and got the same result with all of them.

Desired Behavior:
I would expect the following to result in an evaluation error due to content not being a String value:

file { '/tmp/foo':
  content => ["a\n", "b\n", "c\n"],
}

Actual Behavior:
File '/tmp/foo' is created with the content "c\n".

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db)
Atlassian logo

Josh Cooper (JIRA)

unread,
Jan 12, 2018, 2:13:03 PM1/12/18
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Team: Platform Core

Rob Braden (JIRA)

unread,
Aug 8, 2018, 5:16:02 PM8/8/18
to puppe...@googlegroups.com
Rob Braden updated an issue
Change By: Rob Braden
Team: Platform Core Coremunity
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Josh Cooper (Jira)

unread,
Jun 11, 2020, 2:24:03 AM6/11/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Epic Link: PUP-7548
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Josh Cooper (Jira)

unread,
Jun 11, 2021, 4:05:02 PM6/11/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-8346
 
Re: File type content attribute accepts non-strings

This is a limitation of puppet's type and provider system. Internally, all properties (things that can be managed about a resource) are treated as arrays, and a custom type can specify that the desired value specified in the manifest can match any or all current values. For example, the groups property for the user resource type. We don't have plans on fixing/change this so I'm going to close.

This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages