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

Add Puppet::FileSystem#replace_file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 6.4.0
    • Component/s: None
    • Template:
      PUP Bug Template
    • Team:
      Coremunity
    • Sprint:
      Platform Core KANBAN
    • Method Found:
      Needs Assessment
    • Release Notes:
      Enhancement
    • Release Notes Summary:
      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.
    • QA Risk Assessment:
      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

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

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support