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

Need to guard against `nil` when calling `Uniquefile#close!` in `ensure` blocks

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • PUP 3.7.0
    • None
    • None
    • 1
    • 2014-09-03

    Description

      in `util.rb#replace_file`, there is an `ensure` block that calls `close!` on the `Uniquefile` object. However, if an exception is thrown during the call to the constructor for `Uniquefile` (e.g., if the user does not have write permissions to the specified directory), then this attempt to call `close!` will result in a NilClass exception, which will mask the original exception.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              chris Chris Price
              Eric Thompson Eric Thompson
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support