If you plan on using namevar to represent a section ... you can
enforce keys to only apply for foo{"common": ...} by putting a simple
check for each key you only want for common. Something like:

if resource.value(:name) != "common" raise ArgumentError, "foobar"

In the newparam for each key in question might do.

ken.

On May 14, 10:50 pm, Paul Lathrop <[email protected]> wrote:
> I'm working on a custom type/provider to handle the config file for a
> piece of internal software. The config file is .ini-like and looks
> something like this:
>
> [common]
> key1 = value1
> key2 = value2
>
> [section1]
> key3 = value3
> key4 = value4
>
> ...
>
> [sectionN]
> key3 = valueN
> key4 = valueN
>
> In other words, there is a [common] section which defines options that
> affect global operation, then a series of sections (similar to
> environments in puppet.conf) which all have a couple of options they
> set. I think I know how to handle the sections, but not the [common]
> part.
>
> One thought was to just treat the [common] section like any of the
> other sections, but I'm not sure how to enforce key1 and key2 *only*
> being specified in [common].
>
> Any ideas?
>
> --Paul
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Puppet Developers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/puppet-dev?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to