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

Regression: puppet help errors out if any application raises while generating help

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • PUP 4.6.0
    • None
    • None
    • 1
    • Client 2016-07-27
    • Bug Fix
    • fix a regression from commit eccd3b which modified puppet to not swallow errors silently, but it caused a regression when a puppet sub-application raises an error

    Description

      PUP-3521 (commit eccd3b modified puppet to not swallow errors silently, but it causes a regression because the result variable is not in scope. To reproduce, modify an app in lib/puppet/application/*.rb to raise an ArgumentError in its help method, then run:

      bundle exec puppet help
      Error: undefined local variable or method `result' for #<Puppet::Interface:0x007fab1b563218>
      ...
      

      The problem line is:

          rescue StandardError
            result << [ "! #{appname}", "! Subcommand unavailable due to error. Check error logs." ]
          end
      

      Although the reproduction steps are contrived, I ran into this problem when I had an application in a module and the application called Puppet.settings.initialize_settings twice, which causes puppet to raise an exception.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support