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

Exception thrown when implementing create in both child and parent provider

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 3.8.7
    • Fix Version/s: None
    • Component/s: Types and Providers
    • Labels:
      None
    • Environment:

      Ubuntu 14.0.4

    • Template:
    • Acceptance Criteria:
      Hide

      mytype{ "test":
         standard => "x",
         special => "y"
       }
      

      Info: Applying configuration version '1483531010'
      child
      parent
      Notice: /Stage[main]/test/MyType['test']/ensure: created
      

      Show
      mytype{ "test" : standard => "x" , special => "y" } Info: Applying configuration version '1483531010' child parent Notice: /Stage[main]/test/MyType['test']/ensure: created
    • QA Risk Assessment:
      Needs Assessment

      Description

      Given this pseudo code

      Puppet::Type.newtype(:mytype) do
       ensurable do
          defaultvalues
          defaultto :present
        end
        feature :myfeature, 'Something important.'
        newproperty(:standard) do
        end
       
        newproperty(:special, :required_features => :myfeature) do
        end
      end
       
      Puppet::Type.type(:mytype).provide(:myProvider) do
       
        mk_resource_methods
       
        def create
          #do something
          puts parent
        end
      end
       
      Puppet::Type.type(:mytype).provide(:myOtherProvider,, :parent => :myProvider) do
       
        has_feature :myfeature
        def create
          #do something
          puts child
          super.create
        end
      end
      

      When I call it

       
       mytype{ "test":
         standard => "x",
         special => "y"
       }
      

      I see the following in the log

      Info: Applying configuration version '1483531010'
      child
      parent
      Error: Could not set 'present' on ensure: undefined method `create' for nil:NilClass at 4:/etc/puppet/manifests/test.pp
      Error: Could not set 'present' on ensure: undefined method `create' for nil:NilClass at 4:/etc/puppet/manifests/test.pp
      Wrapped exception:
      undefined method `create' for nil:NilClass

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                Unassigned
                Reporter:
                myMarck Nicolai Marck Ødum
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support