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

A Puppet report from an interrupted run can cause exit_status to throw an exception

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • PUP 4.10.6
    • PUP 5.3.1
    • None
    • None
    • Platform Core
    • 1
    • Platform Core KANBAN
    • Needs Assessment
    • Not Needed
    • No Action
    • test created for change

    Description

      Recently when playing around with reports in irb, I discovered that the exit_status method raises an exception when called against a report from an interrupted (ctrl + c or other) puppet run.

      irb(main):007:0> a.exit_status
      NoMethodError: undefined method `[]' for nil:NilClass
              from /Users/matthaus/src/puppet/lib/puppet/transaction/report.rb:380:in `exit_status'
              from (irb):7
              from /usr/local/opt/ruby/bin/irb:11:in `<main>'
      

      The metrics instance variable is not fully populated for that report and the lookups performed in the exit_status method are not safe with respect to metrics being an empty hash.

      Attachments

        Activity

          People

            Unassigned Unassigned
            matthaus Past Haus
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support