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

resource parser: add the resource name on the validation error message when using create_resources

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 3.6.0
    • Component/s: None
    • Labels:
      None
    • Template:

      Description

      using create_resources on a new provider type,
      if there is a validation error (a wrong parameter),
      puppet does show the name of the wrong parameter, but it does not show the name of the provider type.

      to reproduce, place these files under ~/test/

      ./simple.pp
      ./modules/util/lib/puppet/provider/simple.rb
      ./modules/util/lib/puppet/type/simple.rb
      

      simple.pp

      $res = {
        'some_useless_file' => {
          path   => '/tmp',
          ensure => 'present',
          wrong_param => 'hello',
        }
      }
      create_resources('simple', $res)
      

      get the two other files from https://gist.github.com/dayglojesus/2569267

      $ puppet apply --modulepath=~/test/modules/  simple.pp 
      Error: Invalid parameter wrong_param on node mac4c.local
      

      with the fix, it should show:

      Error: Invalid parameter wrong_param on simple type on node mac4c.local
      

      ps: I set affected version to "M"; I guess this means "Master".

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              dportabella David Portabella
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support