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

Tests for providers inheriting from providers of another type

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 3.7.0
    • Component/s: Types and Providers
    • Labels:
      None
    • Template:
    • Story Points:
      1
    • Sprint:
      Week 2014-6-4 to 2014-6-11

      Description

      It's sometimes desirable to create new providers that inherit from providers of a different type. The inifile module does this currently to create more specialised types:
      https://github.com/puppetlabs/puppetlabs-inifile#implementing-child-providers

      Puppet::Type.type(:glance_api_config).provide(
        :ini_setting,
        # set ini_setting as the parent provider
        :parent => Puppet::Type.type(:ini_setting).provider(:ruby)
      ) do
      

      The "ini_setting" type has a standard "ruby" provider, but here a new "glance_api_config" type has been created which has an "ini_setting" provider itself derived from the standard "ruby" provider from ini_setting (the type).

      We want to use a similar technique in augeasproviders to have a standard provider containing utility implementations, then let others derive from it to create specialised providers. This also neatly sidesteps many issues with loading library code from Puppet providers.

      This works today, but I'd like to add tests in core to prove it works and to ensure this functionality remains.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              domcleal Dominic Cleal
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support