[PUP-2458] Tests for providers inheriting from providers of another type Created: 2014/05/05  Updated: 2014/09/04  Resolved: 2014/06/05

Status: Closed
Project: Puppet
Component/s: Types and Providers
Affects Version/s: None
Fix Version/s: PUP 3.7.0

Type: Improvement Priority: Minor
Reporter: Dominic Cleal Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

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.



 Comments   
Comment by Andrew Parker [ 2014/05/14 ]

Merged into master in f5d56b

Comment by Adrien Thebo [ 2014/06/05 ]

This is a nonfunctional change and so can skip FR.

Generated at Tue Aug 20 23:58:13 PDT 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.