Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-11345

Puppet::FileSystem.chmod doesn't validate its arguments like other FS methods

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • PUP 7.13.0, PUP 6.26.0
    • 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

      Attachments

        Activity

          People

            josh Josh Cooper
            josh Josh Cooper
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support