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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 3.7.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Epic Link:
    • Story Points:
      1
    • Sprint:
      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

              • Assignee:
                Unassigned
                Reporter:
                chris Chris Price
                QA Contact:
                Eric Thompson
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support