Jira (PUP-11345) Puppet::FileSystem.chmod doesn't validate its arguments like other FS methods

16 views
Skip to first unread message

Josh Cooper (Jira)

unread,
Nov 9, 2021, 7:50:02 PM11/9/21
to puppe...@googlegroups.com
Josh Cooper created an issue
 
Puppet / Bug PUP-11345
Puppet::FileSystem.chmod doesn't validate its arguments like other FS methods
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2021/11/09 4:48 PM
Priority: Normal Normal
Reporter: Josh Cooper

Puppet::FileSystem methods generally assert that they are passed either a String or Pathname and raise ArgumentError if that isn't the case. For example:

irb(main):009:0> Puppet::FileSystem.mkpath(nil)
...
ArgumentError (FileSystem implementation expected Pathname, got: 'NilClass')

However, Puppet::FileSystem.chmod raises an unhelpful TypeError trying to convert nil to a String:

irb(main):007:0> Puppet::FileSystem.chmod(0644, nil)
...
TypeError (no implicit conversion of nil into String)

The chmod method should raise ArgumentError like the other methods

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Josh Cooper (Jira)

unread,
Nov 9, 2021, 8:29:01 PM11/9/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 6.26.0
Fix Version/s: PUP 7.13.0

Josh Cooper (Jira)

unread,
Nov 9, 2021, 8:30:01 PM11/9/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-11345
 
Re: Puppet::FileSystem.chmod doesn't validate its arguments like other FS methods

I ran into this while researching PUP-11312 and broke it out into a separate ticket and PR

Josh Cooper (Jira)

unread,
Nov 9, 2021, 8:30:01 PM11/9/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Nov 9, 2021, 8:30:02 PM11/9/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Nov 9, 2021, 8:30:02 PM11/9/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Nov 11, 2021, 4:57:03 PM11/11/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Nov 19, 2021, 11:31:02 AM11/19/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Nov 19, 2021, 11:32:02 AM11/19/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes: Bug Fix
Release Notes Summary: Puppet::FileSystem.chmod now validates its arguments like other methods like mkpath, etc.

Parker Leach (Jira)

unread,
Dec 7, 2021, 10:48:01 PM12/7/21
to puppe...@googlegroups.com
Parker Leach updated an issue
Change By: Parker Leach
Labels: docs_reviewed
This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages