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

puppet generate types should return non-zero when types cannot be generated

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • PUP 6.26.0, PUP 7.14.0
    • None
    • Night's Watch
    • 2
    • NW - 2021-12-06, NW - 2021-12-17, NW - 2022-01-04
    • Needs Assessment
    • Bug Fix
    • Hide
      Fix an issue where puppet generate would return an exit code with the value of 0 even when failing to generate a new custom type by creating a new Puppet::Generator method that checks whether a type has raised an error or not
      Show
      Fix an issue where puppet generate would return an exit code with the value of 0 even when failing to generate a new custom type by creating a new Puppet::Generator method that checks whether a type has raised an error or not
    • Needs Assessment

    Description

      When puppet generate types cannot generate types, it will error, but it explicitly just logs it and keeps going.

      https://github.com/puppetlabs/puppet/blob/1a13e0cf96c70b303492e684f9ccf4c38207b3dd/lib/puppet/generate/type.rb#L204-L211

      [~/.puppetlabs/etc/code/environments/production]$ puppet generate types
      Notice: Generating Puppet resource types.
      Error: /Users/ben/.puppetlabs/etc/code/environments/production/modules/drupal/lib/puppet/type/drupal_module.rb: title patterns that use procs are not supported.
      Error: /Users/ben/.puppetlabs/etc/code/environments/production/modules/drupal/lib/puppet/type/drupal_theme.rb: title patterns that use procs are not supported.
      Error: /Users/ben/.puppetlabs/etc/code/environments/production/modules/drupal/lib/puppet/type/drupal_variable.rb: title patterns that use procs are not supported.
      [~/.puppetlabs/etc/code/environments/production]$ echo $?
      0
      

      This might be so that code manager doesn't fail when code is deployed, but this is certainly not expected. Should there be an option for explicit error codes?

      Attachments

        Issue Links

          Activity

            People

              victor.bobosila Victor Bobosila
              ben.ford Ben Ford
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support