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

Add Puppet::FileSystem#replace_file

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • PUP 6.4.0
    • None
    • Enhancement
    • Hide
      Adds a method Puppet::FileSystem.replace_file for atomically replacing a file, and modifies the SSL code to use it when saving keys and certs. If a mode is specified, it will always be applied to the file. Otherwise, if the file being replaced exists, it's mode will be preserved. If the file doesn't exist, then the mode will default to 0640. This method supersedes Puppet::Util.replace_file, and the latter will be deprecated in a future release.
      Show
      Adds a method Puppet::FileSystem.replace_file for atomically replacing a file, and modifies the SSL code to use it when saving keys and certs. If a mode is specified, it will always be applied to the file. Otherwise, if the file being replaced exists, it's mode will be preserved. If the file doesn't exist, then the mode will default to 0640. This method supersedes Puppet::Util.replace_file, and the latter will be deprecated in a future release.
    • Needs Assessment

    Description

      Puppet's Puppet::Util.replace_file predates Puppet::FileSystem. Now that we have different filesystem implementations (windows, posix, jruby), we should add a replace_file method and respective implementations. The new version should raise standard Errno exceptions. On Windows specifically, it shouldn't leak Puppet::Util::Windows::Errors, as it forces the caller to have conditional logic as to which exceptions it may need to catch.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support