Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/inherited purging #50

Merged
merged 7 commits into from
Jul 16, 2013
Merged

Conversation

richardc
Copy link
Contributor

This adds a mechanism for allowing ini_setting subclasses to override the formation of the namevar during .instances, to allow for ini_setting derived types that manage flat ini-file-like files and still purge them.

It includes and supercedes PR #49, as the spec tests I added were useful.

In order to test with rspec-puppet we need to set up the fixtures, and test via
rake spec, so we change that too
If you follow the example in the README you may not have implemented the
:key_value_separator parameter in your type, and you get the wonderful failure
case:

   Puppet::Error: Invalid parameter key_val_separator(:key_val_separator)

This change looks first, and if the user hasn't specified that attribute in
their type in their type, it falls back to '='
This is useful for testing with puppet apply
The default type would always have a section as part of its namevar, but if
you're inheriting from ini_setting you may be modelling a flat file with no
sections.

This pushes the formation of the namevar from the section_name and setting into
a method, then demonstrates overriding it so that inherited_ini_setting can just
be

   inherited_ini_file { 'setting':
     value => '12',
   }

and continue to be purgable.
Extract the names from all the instances, and check they don't have the form
`[ '/green', '/red' ]` which they would if the inheritance doesn't work.
apenney pushed a commit that referenced this pull request Jul 16, 2013
@apenney apenney merged commit 14ef514 into puppetlabs:master Jul 16, 2013
@smortex smortex added the bugfix label Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants