Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
None
-
Coremunity
-
Coremunity Kanban
-
Needs Assessment
-
Bug Fix
-
Puppet::FileSystem.chmod now validates its arguments like other methods like mkpath, etc.
-
Needs Assessment
Description
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